<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Awesome projects blog</title>
    <description>This blog will show you some of the awesome projects I contributed to.</description>
    <link>https://blog.hetzenecker.me</link>
    <atom:link href="https://blog.hetzenecker.me/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Mon, 22 Sep 2025 23:31:04 +0200</pubDate>
    <lastBuildDate>Mon, 22 Sep 2025 23:31:04 +0200</lastBuildDate>
    <generator>Jekyll v4.4.1</generator>
    <managingEditor>lukas@hetzenecker.me (Lukas Hetzenecker)</managingEditor>
    
      <item>
        <title>GSoC Final report - Part 3: Summary</title>
        <description>
          &lt;p&gt;I can’t believe the three months are already over, the time flies when you’re having
fun.&lt;/p&gt;

&lt;p&gt;Unfortunately, I couldn’t tackle everything I had planned - the rendering in
&lt;a href=&quot;/2017-08-28-gsoc-final-report-1-okular/&quot;&gt;Okular&lt;/a&gt; and &lt;a href=&quot;/2017-08-29-gsoc-final-report-2-gwenview/&quot;&gt;Gwenview&lt;/a&gt; was much complexer than I anticipated. Once again, it needs much more time to modify existing code than to write new one.&lt;/p&gt;

&lt;p&gt;Nevertheless, I enjoyed this challenge and hope the code for Okular will be merged
in the next days and can therefore be in the next release - making HiDPI a more
pleasant experience for the whole KDE community.&lt;/p&gt;

&lt;p&gt;I also have to say this community is great, and I can highly recommend it for
future students - you will certainly make many friends here. There are so many
people trying to help you and making sure you have a good time. You’ll be challenged,
but there is much to learn.&lt;/p&gt;

&lt;p&gt;And go to Akademy - there will not only be many interesting talks, but you’ll also
get to know your mentor and have great fun there (and it will be in Vienna next year :wink:).&lt;/p&gt;

&lt;p&gt;So a huge thanks to my mentor, David Edmundson, to Valorie, for guiding us along the way, to the reviewers of my patches, and to anyone else who helped in the last months.&lt;/p&gt;

&lt;p&gt;I definitely want to stay a KDE contributor and continue with the patches, also
after my GSoC period is over. For the next few weeks however, I will be traveling
without access to the internet. See you in a month!&lt;/p&gt;

        </description>
        <pubDate>Tue, 29 Aug 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-08-29-gsoc-final-report-3-summary/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-08-29-gsoc-final-report-3-summary/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>GSoC Final report - Part 2: Gwenview</title>
        <description>
          &lt;h1 id=&quot;current-status&quot;&gt;Current status&lt;/h1&gt;

&lt;p&gt;Getting there!&lt;/p&gt;

&lt;p&gt;A first revision of my patch is up on &lt;a href=&quot;https://phabricator.kde.org/D7581&quot;&gt;phabricator&lt;/a&gt;,
which works for raster graphics. Your holiday pictures should now open in all
their details and no longer be a blurry mess!&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/gwenview.png&quot; alt=&quot;&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;Left: HiDPI-scaling enabled version; Right: Non-HiDPI rendering. Look at the tree branches.&lt;/p&gt;
    
&lt;/div&gt;

&lt;h1 id=&quot;whats-left-to-do&quot;&gt;What’s left to do?&lt;/h1&gt;

&lt;p&gt;Besides the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RasterImageView&lt;/code&gt;, there is also the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SvgImageView&lt;/code&gt; and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VideoViewAdapter&lt;/code&gt;
that still need fixing. And the thumbnails.&lt;/p&gt;

&lt;h1 id=&quot;difficulties--lessons-learned&quot;&gt;Difficulties &amp;amp; Lessons learned&lt;/h1&gt;

&lt;p&gt;This was particularly challenging, because for every &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QSize&lt;/code&gt; that got used in the
whole rendering stack, I had to check if the size was in the right coordinates.
If it wasn’t, the whole rendering would break. That was pretty difficult for debugging,
because garbled pictures meant that at least one size had to be wrong - somewhere
in a few thousands lines of code.&lt;/p&gt;

        </description>
        <pubDate>Tue, 29 Aug 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-08-29-gsoc-final-report-2-gwenview/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-08-29-gsoc-final-report-2-gwenview/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>GSoC Final report - Part 1: Okular</title>
        <description>
          &lt;p&gt;This is the first post of a 3-part series where I will go into technical details
of my summer of code project. I will give a high-level overview about the
current state of my written code, show you what’s supposed to work and how you
can try that; and what still needs to be done.&lt;/p&gt;

&lt;p&gt;Then I will write about some “Gotcha!” moments I have experienced in the past few
months and what I could learn from them. Those aren’t in any way ordered and
are there to explain why my project turned out like it did - and hopefully
even help some future GSoC students along the way.&lt;/p&gt;

&lt;p&gt;Enough with the introduction, let’s get into the details…&lt;/p&gt;

&lt;h2 id=&quot;current-status&quot;&gt;Current status&lt;/h2&gt;

&lt;p&gt;Nearly finished!&lt;/p&gt;

&lt;p&gt;The review request is up on &lt;a href=&quot;https://phabricator.kde.org/D6268&quot;&gt;phabricator&lt;/a&gt;
and currently in the 4th revision.&lt;/p&gt;

&lt;p&gt;By and large there are no more showstoppers present and the code is in
mergeable quality. Although there are still a few smaller issues present,
I think those could be fixed independently in a later revision.&lt;/p&gt;

&lt;p&gt;You are encouraged to test my patch, I’m happy about every feedback I can get!&lt;/p&gt;

&lt;h2 id=&quot;whats-left-to-do&quot;&gt;What’s left to do?&lt;/h2&gt;

&lt;p&gt;Not much. There are still some rendering bugs in obscure places (e.g. when
  drawing on the screen while in presentation mode).&lt;/p&gt;

&lt;p&gt;I also stumbled upon other bugs (more on that later), but those were out of scope.&lt;/p&gt;

&lt;h2 id=&quot;difficulties--lessons-learned&quot;&gt;Difficulties &amp;amp; Lessons learned&lt;/h2&gt;

&lt;h3 id=&quot;tracking-pixmaps&quot;&gt;Tracking pixmaps&lt;/h3&gt;

&lt;p&gt;I’ve described in the &lt;a href=&quot;/2017-08-10-gsoc-hidpi-examples/&quot;&gt;examples&lt;/a&gt;
how enabling HiDPI support basically works. So at first, I thought it was a
good idea to track down any place where a pixmap is created, increase its size
and set its device pixel ratio to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QPaintDevice::devicePixelRatio()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This had several shortcomings: First, I had to track down where every single
pixmap of the application got created. Secondly, I had to introduce getters
and setters or extend existing method signatures, so I knew the DPR value of the
current screen in every class a pixmap is generated. This was not only
cumbersome, but also broke the ABI (application binary interface) - one mustn’t
extend functions of the library with another parameter.&lt;/p&gt;

&lt;p&gt;Therefore I had to look for another approach: Instead at setting the DPR directly
after creating, I noticed it was sufficient to do so just before painting the pixmap,
because its value is only used for the layout size. I also filled the pixmap cache
with images enlarged by the factor &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QApplication::devicePixelRatio()&lt;/code&gt; - this
means that the window can be freely moved between screens with differing scaling
factors while the cache stays valid and the documents are correctly rendered. Also,
the code was much more concise: The only changes needed were in the
&lt;a href=&quot;https://cgit.kde.org/okular.git/tree/core/generator.cpp?h=gsoc2017_hidpi_support#n494&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PixmapRequest&lt;/code&gt;&lt;/a&gt;, where the larger images were automatically requested; and in the rendering code - pageview.cpp, pagepainter.cpp, pageviewannotator.cpp and presentationwidget.cpp.&lt;/p&gt;

&lt;h3 id=&quot;scaling-icons&quot;&gt;Scaling icons&lt;/h3&gt;

&lt;p&gt;Okular includes some app-specific icons, which weren’t yet HiDPI-ready.&lt;/p&gt;

&lt;p&gt;So I tried to fix it by generating higher resolution PNGs from the SVG source,
and install them via cmake, similar to that:&lt;/p&gt;

&lt;div class=&quot;language-cmake highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nf&quot;&gt;ecm_install_icons&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;ICONS
    32-actions-tool-base-okular.png
    64-actions-tool-base-okular.png
[...]
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Afterwards I should be able to just load the correct version of the icon via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QIcon::fromTheme(QStringLiteral(&quot;tool-base-okular&quot;))&lt;/code&gt;, right?&lt;/p&gt;

&lt;p&gt;Yes, that works… for simple, square icons. Which the annotation icons weren’t.&lt;/p&gt;

&lt;p&gt;So David showed me another nifty trick:
If there is a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tool-base-okular@2x.png&lt;/code&gt; file next to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tool-base-okular.png&lt;/code&gt;,
Qt recognizes this and will automatically load the HiDPI version with the right
scaling factor set when requesting this icon.&lt;/p&gt;

&lt;p&gt;But when dealing with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QPixmap&lt;/code&gt;s - instead of icons -, one must directly load
this version:&lt;/p&gt;

&lt;div class=&quot;language-c++ highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Load HiDPI variant on HiDPI screen&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;QString&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;imageVariant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;qApp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;devicePixelRatio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1.05&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;imageVariant&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;@2x&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;pixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;QStandardPaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;locate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;QStandardPaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GenericDataLocation&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;QString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;okular/pics/tool-base-okular&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;imageVariant&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;.png&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;complexity&quot;&gt;Complexity&lt;/h3&gt;

&lt;p&gt;As already mentioned in my &lt;a href=&quot;/2017-06-30-gsoc-kdegraphics-okular/&quot;&gt;previous post&lt;/a&gt; the rendering code is really complex
and, in my opinion, difficult to understand in the beginning.&lt;/p&gt;

&lt;p&gt;Besides the many different codepaths - depending on the availability of a tile manager,
the need for for back buffering or the cases where images are not yet ready -
some of the code is also already showing symptom of old age.&lt;/p&gt;

&lt;p&gt;It was written for Qt 3.3, and then ported over to newer versions. Nowadays some
functions could be much simpler and cleaner. Whenever possible, I tried to modernize
the code, but a complete overhaul was out of scope. Thankfully, I was &lt;a href=&quot;https://cgit.kde.org/okular.git/commit/?id=024d25cdeca11f9cd012b4e5099b1b4cb91826de&quot;&gt;not the
only one&lt;/a&gt;
trying to solve this technical debt though.&lt;/p&gt;

&lt;h3 id=&quot;chasing-ghosts&quot;&gt;Chasing ghosts&lt;/h3&gt;

&lt;p&gt;A few weeks ago, I was at a state where I could open PDF documents, zoom into them
and the rendering worked. I tried to open a PNG images, and that behaved also as it
should have. I was pleased with myself.&lt;/p&gt;

&lt;p&gt;But for testing, I wanted to make sure every filetype worked. And they all did
reasonably well - until I got to multipage TIFF documents.&lt;/p&gt;

&lt;p&gt;Those were completely broken, shown in a wrong aspect ratio and generally bahaving
quite strange. I was puzzled, because everything else up to that point had worked
so well.&lt;/p&gt;

&lt;p&gt;I quickly checked the Okular release included in my distribution, noticed that
the image got rendered there correctly and then tried to find the bug in my code.
If I had been a bit more careful at this step, I could have saved myself several hours
of scratching my head and wondering what the hell I got wrong there.&lt;/p&gt;

&lt;p&gt;Because, as I noticed after those frustrating hours, my distribution rendered the
image using the general “Image Backend”, not the specialized one for TIFFs.
As I’ve already checked before the “Image Backend” was working fine, but the
TIFF generator &lt;a href=&quot;https://bugs.kde.org/show_bug.cgi?id=371828&quot;&gt;had an already known bug&lt;/a&gt; -
it looks like this hasn’t worked since 2006.&lt;/p&gt;

&lt;h3 id=&quot;fractional-scaling&quot;&gt;Fractional scaling&lt;/h3&gt;

&lt;p&gt;As already mentioned, getting fractional scaling correct is not easy.
I had to fix many off-by-one and rounding errors and until the rendering finally looked good.&lt;/p&gt;

&lt;h3 id=&quot;development-setup&quot;&gt;Development setup&lt;/h3&gt;

&lt;p&gt;For development, I set up a new user account and built the workspace, frameworks
and applications with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kdesrc-build&lt;/code&gt;. But this also had one downside: I once spent
many hours narrowing down a crash of the application for seemingly random reasons
when calling &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QAction::setEnabled&lt;/code&gt;. Turns out there was a bug in the master branch
of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;KXmlGui&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A good tip for future students is to get acquaint with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gdb&lt;/code&gt; soon, at least I had
to use it heavily.&lt;/p&gt;

&lt;p&gt;My setup also included two screens, which also meant a great deal of configuration
hassle.&lt;/p&gt;

&lt;h3 id=&quot;side-trip-to-the-qt-source-code&quot;&gt;Side trip to the Qt source code&lt;/h3&gt;

&lt;p&gt;Sometimes, I also had to look directly into the source of the Qt Framework
to better understand some things. Luckily, I had compiled it myself, and therefore
this was easy.&lt;/p&gt;

&lt;p&gt;On one such instance I had to check that the copy constructor of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QPixmap&lt;/code&gt;s
doesn’t perform a deep copy of the whole pixmap data after changing some data.
The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;setDevicePixelRatio&lt;/code&gt; method does call &lt;a href=&quot;http://doc.qt.io/qt-5/qexplicitlyshareddatapointer.html#detach&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;detach()&lt;/code&gt;&lt;/a&gt; when changing the value,
but luckily the underlying &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QPlatformPixmap&lt;/code&gt; stays the same.&lt;/p&gt;

&lt;h2 id=&quot;testing&quot;&gt;Testing&lt;/h2&gt;

&lt;p&gt;I set up a &lt;a href=&quot;https://drive.google.com/open?id=1P_m9XEwR6HXouP5YFykgbz0EOhvyV-Aql5hGbCpF3j0&quot;&gt;test plan&lt;/a&gt;
to check that i didn’t break things along the way.&lt;/p&gt;

&lt;p&gt;In hindsight, this was a clever thing to do at the start, because it also allowed
me to see my progress - which functionality already worked and what still needed
to be changed.&lt;/p&gt;

&lt;p&gt;You made it to the end of the post, here is a cake for you! :cake:
If you’re still reading, the future of Okular has to matter for you. Therefore
I would be happy if you could &lt;a href=&quot;https://phabricator.kde.org/D6268&quot;&gt;try out my patch&lt;/a&gt;
and give me a quick feedback how it works for you.&lt;/p&gt;

        </description>
        <pubDate>Mon, 28 Aug 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-08-28-gsoc-final-report-1-okular/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-08-28-gsoc-final-report-1-okular/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>GSoC Status report - HiDPI Howto</title>
        <description>
          &lt;p&gt;I’ve something special planned for this blog post: This time, I will not only describe what I did in the last weeks, but I will go into some detail how I did it.&lt;/p&gt;

&lt;p&gt;This blog post is the first one of a two-part-series where I demonstrate my work with practical examples. For the beginning, I don’t want to focus on specific applications (this will follow later!), but demonstrate basic HiDPI concepts with a minimalistic demo application. If you already had to do with HiDPI scaling in Qt once, you can probably skip this post. If you’re developing a Qt application that somewhere deals with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QPixmap&lt;/code&gt;s directly, this is the post for you!&lt;/p&gt;

&lt;p&gt;To make those examples as simple and less verbose as possible, they are written in Python with PyQt. The concepts can be translated to C++/Qt 1-to-1.&lt;/p&gt;

&lt;h1 id=&quot;enabling-hidpi&quot;&gt;Enabling HiDPI&lt;/h1&gt;

&lt;p&gt;A log of HiDPI handling stuff is already done transparently in the Qt Framework: Starting with Qt 5.6 the framework checks if the environment variable &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QT_SCREEN_SCALE_FACTORS&lt;/code&gt; is set - this variable can be configured in a KDE world using the SystemSettings Display module. Before 5.6 the env variable &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QT_DEVICE_PIXEL_RATIO&lt;/code&gt; (now deprecated!) was checked, but the newer approach not only allows configuring the scaling factor independently for each screen, but - in theory - also supports rational numbers. Why this only works in theory, you can read in a later blog post.&lt;/p&gt;

&lt;p&gt;So this means that most of the stuff already works out of the box in Qt - unless an application has specifically opted out of enabling automatic scaling based on the pixel by setting the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Qt::AA_DisableHighDpiScaling&lt;/code&gt; attribute on a &lt;a href=&quot;http://doc.qt.io/qt-5/qt.html#ApplicationAttribute-enum&quot;&gt;QApplication&lt;/a&gt;, like plasmashell does.&lt;/p&gt;

&lt;h1 id=&quot;dealing-with-pixmaps&quot;&gt;Dealing with pixmaps&lt;/h1&gt;

&lt;p&gt;Here is our requirement for our Proof of Concept: We want to draw a KDE logo, as clear and shiny as possible!&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/kde.png&quot; alt=&quot;KDE logo&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;KDE logo, used for the examples below&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;How would we do this? One possible solution could like this:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PyQt5.QtCore&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PyQt5.QtGui&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PyQt5.QtWidgets&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QApplication&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;QMainWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

        &lt;span class=&quot;n&quot;&gt;pixmap&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QPixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;./kde.png&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

        &lt;span class=&quot;n&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QLabel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;setPixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

        &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;setCentralWidget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;contextMenuEvent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QAction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;QIcon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;./kde.png&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;KDE&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

        &lt;span class=&quot;n&quot;&gt;menu&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QMenu&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;menu&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;addAction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;menu&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;exec_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;globalPos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;


&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;exec_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Starting this piece of code with scaling enabled (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python QT_SCREEN_SCALE_FACTORS=2 demo.py&lt;/code&gt;) results in the following output:&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/ex_mainwindow.png&quot; alt=&quot;&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;Huh, what’s going on here? Haven’t I said that Qt is able to figure out all basic scaling stuff on its own?&lt;/p&gt;

&lt;p&gt;Yes, it does.. but we have to tell Qt explicitly to enable this setting via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Qt::AA_UseHighDpiPixmaps&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Make QIcon::pixmap() generate high-dpi pixmaps that can be larger than the requested size. Such pixmaps will have devicePixelRatio() set to a value higher than 1. After setting this attribute, application code that uses pixmap sizes in layout geometry calculations should typically divide by devicePixelRatio() to get device-independent layout geometry.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This was made opt-in, because the returned pixmap can be larger than the requested size and therefore break existing code. Applications that opt-in to this feature need to make sure that they actually provide large enough pixmaps.&lt;/p&gt;

&lt;p&gt;Enabling this …&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Qt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AA_UseHighDpiPixmaps&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;… improves things a bit:&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/ex_mainwindow_2.png&quot; alt=&quot;&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;At least the icon in the context menu is now drawn without blurrying.&lt;/p&gt;

&lt;p&gt;But what can we do with the main pixmap? Let’s simplify the code first:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QLabel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;setWindowTitle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Pixmap&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;pixmap&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QPixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;./kde.png&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;setPixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/ex_pixmap.png&quot; alt=&quot;&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;Qt uses two coordinate systems internally: the &lt;em&gt;device independent pixels&lt;/em&gt; coordinate system, which is used for the gemoetry of widgets and items; and the &lt;em&gt;device pixels&lt;/em&gt; coordinate system, which translates to the rendered output, that corresponds to the display resolution. &lt;em&gt;The ratio between the device independent and device pixel coordinate systems is the devicePixelRatio.&lt;/em&gt; QPixmap does not know what this ratio should be and therefore can’t take it into account automatically. For this reason the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;devicePixelRatio&lt;/code&gt; also needs to be set:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;pixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;setDevicePixelRatio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;devicePixelRatioF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This results in the correct scaling (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QSize layoutSize = image.size() / image.devicePixelRatio()&lt;/code&gt;) of the pixmap:&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/ex_pixmap_2.png&quot; alt=&quot;&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;Side note: Have you noticed we used the devicePixelRatio&lt;strong&gt;F&lt;/strong&gt; method? This is a new method since Qt 5.6, which returns a real value, instead of the old integer value of devicePixelRatio. Use the real variant, whenever possible!&lt;/p&gt;

&lt;h1 id=&quot;multiple-monitors-with-different-scale-factors&quot;&gt;Multiple monitors with different scale factors?&lt;/h1&gt;

&lt;p&gt;As I’ve seen while working on Okular and Gwenview, pixmaps often get cached.&lt;/p&gt;

&lt;p&gt;Their implementation is vastly more complex than the example given below, but this implementation shows a simple caching strategy:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;QMainWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_width&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_height&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_pixmap&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;

        &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;paintEvent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_pixmap&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;dpr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;devicePixelRatioF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;pixmap&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QPixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;./kde-large.png&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_pixmap&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;scaled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dpr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dpr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transformMode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Qt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SmoothTransformation&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_pixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;setDevicePixelRatio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dpr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

        &lt;span class=&quot;n&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QPainter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;drawPixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_pixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

        &lt;span class=&quot;nf&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Pixmap DPR: %s / PaintDevice DPR: %s&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_pixmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;devicePixelRatioF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;devicePixelRatioF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This already looks quite good. But can you guess what could still go wrong here?&lt;/p&gt;

&lt;p&gt;In Qt we can have different screens - even with different ratio between device independent and device pixels.
If the second screen has a higher DPR value, the cached pixmap is too small.&lt;/p&gt;

&lt;p&gt;Here is a demonstration:&lt;/p&gt;

&lt;style&gt;.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }&lt;/style&gt;
&lt;div class=&quot;embed-container&quot;&gt;    &lt;iframe title=&quot;YouTube video player&quot; width=&quot;640&quot; height=&quot;390&quot; src=&quot;//www.youtube.com/embed/OPmsWUhhruc&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;

&lt;p&gt;As a workaround, we can use the highest DPR value of all screens for the caching of the pixmap. In Qt, this is available via&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;dpr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;qApp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;devicePixelRatio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;Returns the highest screen device pixel ratio found on the system. This is the ratio between physical pixels and device-independent pixels.&lt;/p&gt;

  &lt;p&gt;Use this function only when you don’t know which window you are targeting. If you do know the target window, use QWindow::devicePixelRatio() instead.
&lt;a href=&quot;http://doc.qt.io/qt-5/qguiapplication.html#devicePixelRatio&quot;&gt;Qt documentation&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;style&gt;.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }&lt;/style&gt;
&lt;div class=&quot;embed-container&quot;&gt;    &lt;iframe title=&quot;YouTube video player&quot; width=&quot;640&quot; height=&quot;390&quot; src=&quot;//www.youtube.com/embed/qi0_DX7yVo4&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;

&lt;p&gt;And now we finally have the shiny KDE logo in all its glory!&lt;/p&gt;

        </description>
        <pubDate>Thu, 10 Aug 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-08-10-gsoc-hidpi-examples/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-08-10-gsoc-hidpi-examples/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>Akademy 2017.. and 2018!</title>
        <description>
          &lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/P1050877.JPG&quot; alt=&quot;Malaga&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;Quick stop in Malaga, before getting on a bus to Almería&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;As a Summer of Code student, I used the opportunity to meet my mentor &lt;a href=&quot;http://blog.davidedmundson.co.uk/&quot;&gt;David&lt;/a&gt; and many other members of the community at this years annual Akademy conference in Almería.
This was the first year I attended, so I didn’t know the people I’ve communicated with over IRC and mailing lists in person before. It really helped that I am now able to put faces to the screennames on IRC. And big thanks to  David, that you introduced me to a lot of them.&lt;/p&gt;

&lt;p&gt;The talks were genuinely informative, I especially enjoyed the wonderful future we will see in &lt;a href=&quot;https://conf.kde.org/en/akademy2017/public/events/364&quot;&gt;Plasma Mobile&lt;/a&gt;, and how we can enlarge our (developer) community by &lt;a href=&quot;https://conf.kde.org/en/akademy2017/public/events/359&quot;&gt;supporting further international writing systems&lt;/a&gt;. Features of &lt;a href=&quot;https://conf.kde.org/en/akademy2017/public/events/356&quot;&gt;new C++ releases&lt;/a&gt; were shown, we got on overview on how we can make use of &lt;a href=&quot;https://conf.kde.org/en/akademy2017/public/events/331&quot;&gt;functional constructs&lt;/a&gt; and got some insight into &lt;a href=&quot;https://conf.kde.org/en/akademy2017/public/events/380&quot;&gt;debugging QML&lt;/a&gt;. There were so many informative talks, I unfortunately can’t list all of them!&lt;/p&gt;

&lt;p&gt;I also had the oppertunity to meet &lt;a href=&quot;https://vasudhamathur.wordpress.com/&quot;&gt;Vasudha&lt;/a&gt;, another GSoC student working on a QML interface to Rocket.Chat. I think we two were the only current GSoC stundents present. I can only recommend to future students to go there, it helped me a lot. Not only that you get to meet new friends, but also to hear about the challanges they had when implementing something similar.&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/P1050943.JPG&quot; alt=&quot;Almeria&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;Almería, as seen from San Cristóbal&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;A huge thanks to all of the organisators, without you this wouldn’t have been possible! I hope I can speak for everyone when I say we really enjoyed our time there!&lt;/p&gt;

&lt;p&gt;And lastely, I had the pleasure to announce at the conference that next year Akademy will be going to Vienna, Austria.
I will be co-organizing the event with &lt;a href=&quot;https://twitter.com/Horrendus&quot;&gt;Horrendus&lt;/a&gt; and other members of our local KDE community.&lt;/p&gt;

        </description>
        <pubDate>Fri, 04 Aug 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-08-04-akademy/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-08-04-akademy/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>I&apos;m going to Akademy</title>
        <description>
          &lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/akademy_website_header_2017.png&quot; alt=&quot;Akademy header&quot; /&gt;
    
    
&lt;/div&gt;

&lt;p&gt;As briefly mentioned in my last blog post, I will attend this years Akademy conference in Almería.&lt;/p&gt;

&lt;p&gt;Are there other KDE GSoC students that also will be going there? If yes, it would be great if we could organize some kind of get-together to exchange experiences and socialize. What do you think of this idea?&lt;/p&gt;

        </description>
        <pubDate>Tue, 04 Jul 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-07-04-gsoc-akademy/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-07-04-gsoc-akademy/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>GSoC Status report - Okular</title>
        <description>
          &lt;p&gt;In this post, I want to show you what I did during my first two weeks of the Google Summer of Code.&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/okular-before.png&quot; alt=&quot;Okular before adding support for HiDPI&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;Okular before adding support for HiDPI&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;As you can see in the screenshot, Okular unfortunately is one of the applications that still has rendering problems on HiDPI screens.
That’s bad for me, because I use Okular regularely for reading scientific papers. To be fair, there is a workaround to create a wrapper script which unsets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QT_SCREEN_SCALE_FACTORS&lt;/code&gt;, but this also means everything is displayed unscaled.&lt;/p&gt;

&lt;p&gt;So I decided to focus on the applications in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kdegraphics&lt;/code&gt; module - beginning with okular in the first phase of the GSoC program.&lt;/p&gt;

&lt;p&gt;And - drum roll please! - this is the result of two to three weeks coding:&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/okular-after.png&quot; alt=&quot;Okular after adding support for HiDPI&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;Okular after adding support for HiDPI&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;As you can see, the rendering does now work (if you don’t see the difference, open the images in fullscreen). :-)&lt;/p&gt;

&lt;p&gt;This took more time then I hoped it would, due to two reasons:&lt;br /&gt;
Most of the code that is responsible for the rendering dates back to 2005 - a time, where Qt still belonged to Trolltech and Qt 3.3 was just released. Of course it was ported over to Qt5 and still works, but sometimes I thought there would be a more efficient/simpler solution today. Unfortunately this was out of scope for this project, so there are still &lt;a href=&quot;https://cgit.kde.org/okular.git/tree/ui/pagepainter.cpp#n359&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;https://cgit.kde.org/okular.git/tree/ui/pagepainter.cpp#n395&quot;&gt;places&lt;/a&gt; where the pixels of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QImage&lt;/code&gt;s are modified directly.&lt;/p&gt;

&lt;p&gt;The painting of the individual pages also turned out be be difficult to understand. It basicially happens in one, big, complicated, 1000 line long function. This function contains many &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;if&lt;/code&gt; statements to handle special cases - e.g. there are many blocks that are only executed if there is a tile manager, or if the image needs to be back-buffered (if it contains highlighting or annotations), or if the page is not yet loaded and a loading icon is drawn (with, again, a fallback if this fails too).&lt;/p&gt;

&lt;p&gt;That means testing will also not be that straightforward - in the coming days, I will make sure that all the features still work as expected: all the different document types, with annotations, while zoomed in…&lt;/p&gt;

&lt;p&gt;If you want to try this out, the patch is already up on &lt;a href=&quot;https://phabricator.kde.org/D6268&quot;&gt;phabricator&lt;/a&gt;. Please also leave feedback after testing, this would help me tremendously.&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/okular-dev.gif&quot; alt=&quot;Okular in kdevelop&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;I&apos;m sure there are still a few bugs in here - the first person to spot one will get a beer at Akademy&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;At this point I wanted to tell you about &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gwenview&lt;/code&gt; - the next application I’m tackling in the kdegraphics module. But unfortunately, my patch isn’t ready yet and has to wait for the next blog post…&lt;/p&gt;

        </description>
        <pubDate>Fri, 30 Jun 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-06-30-gsoc-kdegraphics-okular/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-06-30-gsoc-kdegraphics-okular/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>GSoC preparation - Plasma Toolicons - A journey down the rabbit hole</title>
        <description>
          &lt;p&gt;Before writing about my actual Summer of Code experiences, I wanted to briefly share what I worked on before the official coding start.&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/plasma-toolicons.jpg&quot; alt=&quot;Plasma Toolicons&quot; /&gt;
    
    
        &lt;p class=&quot;image-caption&quot;&gt;Plasma toolicons&lt;/p&gt;
    
&lt;/div&gt;

&lt;p&gt;Can you see these ridiculously small toolicons next to the Media frame plasmoid? I’m talking about the icons which allow you to Resize, Rotate and Remove the Plasmoid. Compared with other icons, these are clearly too small.&lt;/p&gt;

&lt;p&gt;So, as preparation for GSoC, I wanted to know why this happens, and what would be required to make them bigger. Thus my journey into the (Plasma) rabbithole began…&lt;/p&gt;

&lt;p&gt;Tracking down where the containment is defined was relatively easy, and shortly after i found the code responsible for the &lt;a href=&quot;https://cgit.kde.org/plasma-desktop.git/tree/containments/desktop/package/contents/ui/ActionButton.qml&quot;&gt;ActionButton&lt;/a&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-qml&quot; data-lang=&quot;qml&quot;&gt;&lt;span class=&quot;kt&quot;&gt;PlasmaCore.ToolTipArea&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;button&lt;/span&gt;

    &lt;span class=&quot;nl&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PlasmaCore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Types&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;LeftEdge&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;mainText&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;undefined&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;mainItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;toolTipDelegate&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;//API&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;QtObject&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;svg&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;alias&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;elementId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;icon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;elementId&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;QtObject&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;action&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;backgroundVisible&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;iconSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;32&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;[...]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Huh, the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iconSize&lt;/code&gt; is 32px? Well, that was easy to fix, surely this should be set to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;units.iconSizes.small&lt;/code&gt; and this problem is gone…&lt;/p&gt;

&lt;p&gt;… or so I thought. No, this didn’t improve the situation, back to square one.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Is it overwritten by the look and feel theme? &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;plasma-workspace/lookandfeel/contents/components/ActionButton.qml&lt;/code&gt; at least doesn’t - and it also happens with the style set to Oxygen.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;While looking at this, I also noticed that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;units.iconSizes.small&lt;/code&gt; returned 16px on my system. This seemed odd, because the scale factor was set to 1.8x, so I would have expected bigger icons.&lt;/p&gt;

&lt;p&gt;Where is this icon size calculated? Ah yes, in the file &lt;a href=&quot;https://lxr.kde.org/source/frameworks/plasma-framework/src/declarativeimports/core/units.cpp?v=stable-kf5-qt5&quot;&gt;units.cpp&lt;/a&gt;, method &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Units::devicePixelIconSize&lt;/code&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-cpp&quot; data-lang=&quot;cpp&quot;&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Units&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;devicePixelIconSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;cm&quot;&gt;/* in kiconloader.h
    enum StdSizes {
        SizeSmall=16,
        SizeSmallMedium=22,
        SizeMedium=32,
[...]
     };
    */&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Scale the icon sizes up using the devicePixelRatio&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// This function returns the next stepping icon size&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// and multiplies the global settings with the dpi ratio.&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;qreal&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ratio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;devicePixelRatio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ratio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
     &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ratio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2.0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
     &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ratio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;[...]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Ok, my &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;devicePixelRatio&lt;/code&gt; is 1.8 and therefore the icon size of a small pixmap gets multiplied by 1.5 and a request for a small (16px) pixmap should return a 24px pixmap.&lt;/p&gt;

&lt;p&gt;But it doesn’t…&lt;/p&gt;

&lt;p&gt;Debugging suggested that my &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;devicePixelRatio&lt;/code&gt; is &lt;em&gt;NOT&lt;/em&gt; 1.8, but rather around 1.4. How did that happen, isn’t the scale factor from the KDE settings used?&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Oh, the comment in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updateDevicePixelRatio()&lt;/code&gt; mentions that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QGuiApplication::devicePixelRatio()&lt;/code&gt; is really not used:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-cpp&quot; data-lang=&quot;cpp&quot;&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Units&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;updateDevicePixelRatio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Using QGuiApplication::devicePixelRatio() gives too coarse values,&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// i.e. it directly jumps from 1.0 to 2.0. We want tighter control on&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// sizing, so we compute the exact ratio and use that.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// TODO: make it possible to adapt to the dpi for the current screen dpi&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;//  instead of assuming that all of them use the same dpi which applies for&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;//  X11 but not for other systems.&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;QScreen&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;primary&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;QGuiApplication&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;primaryScreen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;primary&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
       &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;qreal&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dpi&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;primary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;logicalDotsPerInchX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Usual &quot;default&quot; is 96 dpi&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// that magic ratio follows the definition of &quot;device independent pixel&quot; by Microsoft&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;m_devicePixelRatio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;qreal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dpi&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;qreal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;96&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Hmm, yes, that was the case in earlier Qt versions when &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;devicePixelRatio&lt;/code&gt; still returned an integer - but nowadays the value is a real number.&lt;/p&gt;

&lt;p&gt;So, instead of calculating &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dpi / 96&lt;/code&gt; I just changed it to return &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;primary-&amp;gt;devicePixelRatio()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Which now, finally, should return a devicePixelRatio of 1.8 and therefore result in bigger pixmaps.&lt;/p&gt;

&lt;p&gt;Compiled it, and confident of victory restarted plasmashell… only to notice, that it still didn’t work.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;What could there still go wrong?&lt;/p&gt;

&lt;p&gt;So I got back to debugging.. to notice that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;primary-&amp;gt;devicePixelRatio()&lt;/code&gt; returns a scale factor of 1.0. Huh? Isn’t this supposed to just use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;QT_SCREEN_SCALE_FACTORS&lt;/code&gt; environment variable, which gets set to the value of the “Scale Display” dialog in the Systemsettings? If you want to know, the code for setting the environment variable is located in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;plasma-workspace/startkde/startplasmacompositor.cmake&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But why isn’t the problem gone, is there something in Plasma that overwrites this value?&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Yes, of course there is!&lt;/p&gt;

&lt;p&gt;The only way this value can be overwritten is due to the Qt attribute &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Qt::AA_DisableHighDpiScaling&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Grep’ing for that one pointed me to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;plasma-workspace/shell/main.cpp&lt;/code&gt; - the base file for plasmashell:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-cpp&quot; data-lang=&quot;cpp&quot;&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;argc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[])&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//    Devive pixel ratio has some problems in plasmashell currently.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//     - dialog continually expands (347951)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//     - Text element text is screwed (QTBUG-42606)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//     - Panel struts (350614)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//  This variable should possibly be removed when all are fixed&lt;/span&gt;

   &lt;span class=&quot;n&quot;&gt;qunsetenv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;QT_DEVICE_PIXEL_RATIO&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;QCoreApplication&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Qt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AA_DisableHighDpiScaling&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;p&gt;I looked into the mentioned bugs. What should I do now? Re-enabling the HighDpiScaling-flag so the real devicePixelRatio is returned in Qt, and therefore I can use this value to calculate the sizes icons should be and then have the bigger Plasma ToolIcons? At least QTBUG-42606 seems to be fixed…&lt;/p&gt;

&lt;p&gt;Oh boy, what have I gotten into now…&lt;/p&gt;

&lt;p&gt;It was time to talk to my mentor!&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;David Edmundson quickly noticed that there should be no mismatch with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dpi / 96&lt;/code&gt; calculation.
Something fishy seems to be going on here…&lt;/p&gt;

&lt;p&gt;What is this dpi value anyway? This is the one reported by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xrdb -query |grep Xft.dpi&lt;/code&gt; and managed in the file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$HOME/.config/kcmfonts&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And that value - as you probably can guess by now - did not make any sense. It didn’t match the expectation of being &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scaleFactor * 96&lt;/code&gt;, the value it &lt;em&gt;should&lt;/em&gt; have been set to.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;On we go to the location where the scaling configuration is set - &lt;a href=&quot;https://cgit.kde.org/kscreen.git/tree/kcm/src/scalingconfig.cpp&quot;&gt;scalingconfig.cpp&lt;/a&gt; in the KScreen KConfig Module.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-cpp&quot; data-lang=&quot;cpp&quot;&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ScalingConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;accept&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;[...]&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;fontConfigGroup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;writeEntry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;forceFontDPI&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scaleDPI&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;[...]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;qreal&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ScalingConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scaleDPI&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scaleFactor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;96.0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;This &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scaleDPI&lt;/code&gt; is then applied with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xrdb -quiet -merge -nocpp&lt;/code&gt; on startup.&lt;/p&gt;

&lt;p&gt;So &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Xft.dpi&lt;/code&gt; is set to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1.8 * 96.0&lt;/code&gt;, or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;172.8&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Have you spotted what is going wrong?&lt;/p&gt;

&lt;p&gt;I did not, but David noticed…&lt;/p&gt;

&lt;p&gt;The X server can only handle real values - and therefore &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;172.8&lt;/code&gt; is simlpy discarded!&lt;/p&gt;

&lt;p&gt;A few moments later this &lt;a href=&quot;https://phabricator.kde.org/D5487&quot;&gt;patch&lt;/a&gt; was ready…&lt;/p&gt;

&lt;div class=&quot;image-wrapper&quot;&gt;
    
        &lt;img src=&quot;https://blog.hetzenecker.me/assets/plasma-toolicons-after.png&quot; alt=&quot;Plasma Toolicons&quot; /&gt;
    
    
&lt;/div&gt;

&lt;p&gt;… and I was finally able to enjoy my icons in all their scaled glory! And you can too, because this patch is already in Plasma 5.10.&lt;/p&gt;

        </description>
        <pubDate>Sun, 25 Jun 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-06-25-gsoc-preparation-plasma/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-06-25-gsoc-preparation-plasma/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>Do you know of any HiDPI issues? - Help me to help you</title>
        <description>
          &lt;p&gt;In my &lt;a href=&quot;https://drive.google.com/file/d/0BwXqDXwyptm8eEo5bjdZRzZTQkk/view?usp=sharing&quot;&gt;proposal&lt;/a&gt; I have linked to a few rendering issues on HiDPI screens, and presented an initial timeline how I plan to fix them.&lt;/p&gt;

&lt;p&gt;But I can still shift my proprities, depending on your input! Do you have any rendering problems with KDE applications on a HiDPI screen? Tell me!&lt;/p&gt;

&lt;p&gt;Just write a comment to this blog post with your most annoying problems, and chances are good that they’ll get fixed during my GSoC time. If there’s already an open issue on the &lt;a href=&quot;https://bugs.kde.org/&quot;&gt;bug tracker&lt;/a&gt;, feel free to link to it. Otherwise, please also state which version of the application you use and what your scale factor (Systemsettings -&amp;gt; Display and Monitor -&amp;gt; Scale Display) is.&lt;/p&gt;

&lt;p&gt;I’ll collect those issues on my &lt;a href=&quot;https://community.kde.org/GSoC/2017/StatusReports/LukasHetzenecker/HiDPI_Issues&quot;&gt;Summer of Code Status Report page&lt;/a&gt;.&lt;/p&gt;

        </description>
        <pubDate>Mon, 15 May 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-05-15-hidpi-issues/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-05-15-hidpi-issues/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>Making Hi-DPI awesome - Hello GSoC!</title>
        <description>
          &lt;p&gt;As already &lt;a href=&quot;http://linuxgrandma.blogspot.com/2017/05/google-summer-of-code-students-are.html&quot;&gt;introduced by Valorie&lt;/a&gt; my proposal was also selected for this years summer of code! :tropical_drink::cocktail::beers::tada::confetti_ball:&lt;/p&gt;

&lt;p&gt;Okay, before celebrating too much prematurely, I should better get started with coding. So what will I work on during the next 3 months?&lt;/p&gt;

&lt;p&gt;Not so long ago, I decided to treat myself with a brand-new 4K monitor - just to improve my productiveness of course. Thanks to &lt;a href=&quot;https://kate-editor.org/2015/10/14/kate-on-mac-hidpi/&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;http://www.lorenzobettini.it/2016/07/hidpi-in-kde-plasma/&quot;&gt;dedicated&lt;/a&gt; &lt;a href=&quot;http://blog.davidedmundson.co.uk/blog/high_dpi_again&quot;&gt;people&lt;/a&gt; the situation was not that bad. Of course, here and there were some quirks, but that’s what you get for living on the bleeding edge, right?&lt;/p&gt;

&lt;p&gt;To my horror it happened that I stumbled upon competing desktop environments (it happened by accident, I swear!) and noticed that the situation there was even a bit better. There were no &lt;a href=&quot;https://bugs.kde.org/show_bug.cgi?id=373178&quot;&gt;blurred images&lt;/a&gt; when opening my last holiday pictures in my favorite image viewer, not even &lt;a href=&quot;https://bugs.kde.org/show_bug.cgi?id=362856&quot;&gt;unreadable documents&lt;/a&gt; when I’ve quickly have to proofread my paper after nearly missing a deadline!&lt;/p&gt;

&lt;p&gt;So, I asked myself, why can’t we have all the nice things too? Well, first of all, because suitable &lt;a href=&quot;http://blog.qt.io/blog/2016/01/26/high-dpi-support-in-qt-5-6/&quot;&gt;HiDPI support in Qt&lt;/a&gt; landed just fairly recently. Secondly, not everyone owns a high-res screen yet (unfortunately!) and therefore might not even be aware of some rendering issues. And thirdly, getting HiDPI rendering correct &lt;a href=&quot;https://phabricator.kde.org/R166:a41e83edbaadd27cd8ea85d4dfa375033e8ade84&quot;&gt;can&lt;/a&gt; &lt;a href=&quot;https://phabricator.kde.org/R166:a41e83edbaadd27cd8ea85d4dfa375033e8ade84&quot;&gt;be&lt;/a&gt; &lt;a href=&quot;https://phabricator.kde.org/D434&quot;&gt;hard&lt;/a&gt; (except for the times when it’s really &lt;a href=&quot;https://phabricator.kde.org/R227:c8bfe579d0c98cadc6938e88d7e9a7307cbf8162&quot;&gt;easy&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;I thought about it and decided that it would be best if the remaining issues would be fixed in a coordinated approach. This way, I can build up enough knowledge about the current HiDPI situation, which I then apply to different applications - details about that can be found in my application &lt;a href=&quot;https://drive.google.com/file/d/0BwXqDXwyptm8eEo5bjdZRzZTQkk/view?usp=sharing&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And hurray! - this proposal really got selected. And what’s even better - it will be mentored by &lt;a href=&quot;http://blog.davidedmundson.co.uk/&quot;&gt;David Edmundson&lt;/a&gt;, the guy that’s already worked on HiDPI support for Plasma and other projects for years.&lt;/p&gt;

&lt;p&gt;I’m really looking forward to the next few months and promise to keep you updated with regular blog posts!&lt;/p&gt;

        </description>
        <pubDate>Mon, 15 May 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-05-15-hello-gsoc/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-05-15-hello-gsoc/</guid>
        <category term="kde"/><category term="gsoc"/>
        
        
      </item>
    
      <item>
        <title>Hello World!</title>
        <description>
          &lt;p&gt;Hello World!&lt;/p&gt;

&lt;p&gt;Right now there’s not yet much to see here, but this is going to change soon: I was selected as Google Summer of Code student and will be working for the KDE project. More details will follow in the next few days.&lt;/p&gt;

&lt;p&gt;Besides my work for KDE, I’ve also planned to post about some ofter projects.. there’s so much awesome stuff to write about, so just subscribe to the feed to stay updated.&lt;/p&gt;

&lt;p&gt;Lukas&lt;/p&gt;

        </description>
        <pubDate>Fri, 12 May 2017 00:00:00 +0200</pubDate>
        <link>https://blog.hetzenecker.me/2017-05-12-hello-world/</link>
        <guid isPermaLink="true">https://blog.hetzenecker.me/2017-05-12-hello-world/</guid>
        
        
        
      </item>
    
  </channel>
</rss>
