-->
Home » » KDE & Qt Applications and High DPI Displays with Scaling.
Sunday
6 October 2019

KDE & Qt Applications and High DPI Displays with Scaling.

What is a High DPI Display?

In the past, most displays had (or the OS pretended to have) around 96 PPI, more or less.

If you differed a bit and had too small/large UI elements, you mostly just resized your default font size a bit and were kind of happy.

In the last years, more and more displays arise that have a much higher PPI values, which allows for e.g. very crisp rendering of text.

I arrived late in that era for my Linux machines by now starting to use two 163 PPI displays.

Just tweaking your fonts doesn’t help here, all other things will still be unbearable small, even if you in addition increase e.g. icon sizes.

A solution for this is the current trend to just “scale” your UI by some factor, for my displays some factor of 1.5 leads to the most pleasant sizes.

How does Qt handle that?

A detailed description on how Qt does try to tackle the challenges of such displays can be found here.

More or less the gist of this is: In your application you work on logical pixels (in most cases) and Qt will do the hard work for you to then paint that in real pixels with the right scaling applied.

In practice, this isn’t fully transparent to the programmer. For example, as soon as you work with QPixmap, you will think a bit about where which pixel variant is used. You need to be careful to not mix-up the size() of a QPixmap 1:1 with let’s say layout/widget sizes in such scaled scenarios, see here.

Fine, nice, but what does that mean in practice?

Let’s take a look at how this works out in practice using the latest stable release of KDE & Qt stuff:

  • KDE Plasma 5.16.5
  • KDE Applications 19.08.1
  • KDE Frameworks 5.62.0
  • Qt 5.13.1

My setup for the below experiments are two 163 PPI displays with scale factor 1.5.

I use some Manjaro Linux with open-source AMD drivers for some average middle class card.

The screenshots are taken on my second screen. I used PNG to avoid that some JPEG artifacts make the real rendering artifacts unclear, bear with the large size.

Experiments on Kate & Konsole

Let’s show the current state with Kate & Konsole, here how Kate 19.08.1 looks if you start it on the second screen with default configuration with COPYING.LIB of ktexteditor.git as file:

This looks kind of strange. What you see is actually no split screen, even that is a pure rendering artifacts, actually, the whole Kate windows is more or less one artifacts.

A user reported this in Bug 411965 - Rendering issue in dual screen hidpi setup. With my new setup I was able to reproduce that, on every Kate start :/

The user himself investigated this and came to the same conclusion as me, the culprit is some winId() call in KonsolePart. As Kate constructs the KonsolePart widget without a parent first and then insert it into a layout, the code inside the part will call winId() on a non-native widget.

This is now fixed and backported to the 19.08 branch.

This means, with 19.08.2, you will have the following experience:

This somehow looks more like an actual working application.

0 commenti:

Post a Comment

Random Posts

  • Guides and tutorials for Manjaro: Checking For Errors By Reading Logs Or Shell Output.
    03.09.2022 - 2 Comments
    Before burning your downloaded ISO image (or using it as a virtual disk in Virtualbox), it is "highly" recommended that you first check if the file has not been corrupted. The consequences of not doing so, mainly if you intend to install Manjaro as…
  • Molecule Man is an isometric 3D arcade adventure game released by Mastertronic in 1986.
    26.09.2013 - 0 Comments
    Molecule Man is an isometric 3D arcade adventure game released by Mastertronic in 1986 for a variety of 8-bit home computers. A level editor is included which enables the player to design their own mazes. Molecule Man is trapped in a radioactive…
  • Fedora is a Linux-based operating system that showcases the latest in free and open source software
    21.08.2008 - 0 Comments
    Fedora is a Linux-based operating system that showcases the latest in free and open source software. Fedora is always free for anyone to use, modify, and distribute.  It is built by people across the globe who work together as a…
  • Multi-Booting the Nexus 7 Tablet: Getting Ubuntu Touch Running.
    04.07.2014 - 0 Comments
    If you've not seen a Nexus 7, it's a nice little device. Like all "Nexus"-branded Android devices, it's a "reference" device for Google's base Android implementation, so it's got a well-supported set of hardware. I'm not trying…
  • Mysqld Command-line Options.
    27.09.2008 - 0 Comments
    In most cases you should manage mysqld options through option files. mysqld and mysqld.server reads options from the mysqld and server groups. mysqld_ safe read options from the mysqld, server, mysqld_safe and safe_mysqld groups. An embedded MySQL…
  • Pinguy OS is an Ubuntu-based distribution targeted at beginning Linux users.
    09.07.2011 - 0 Comments
    Pinguy OS is an Ubuntu-based distribution targeted at beginning Linux users. It features numerous user-friendly enhancements, out-of-the-box support for multimedia codecs and browser plugins, a heavily tweaked GNOME user interface with enhanced…
  • Edubuntu is an official derivative of the Ubuntu operating system designed for use in classrooms inside schools, homes and communities.
    20.05.2011 - 0 Comments
    Edubuntu is a partner project of Ubuntu Linux, a distribution suitable for classroom use. The aim is that an educator with limited technical knowledge and skill will be able to set up a computer lab, or establish an on-line learning environment,…
  • Elive is a distro of Linux based in Debian and with Enlightenment 17 for unique desktop
    20.12.2009 - 0 Comments
    Samuel Baggen has announced the availability of a new development release of Elive, version 1.9.52, a Debian-based distribution featuring the latest build of the Enlightenment 17 desktop: "The Elive team is proud to announce the release of…
  • Guides and tutorials for Zorin OS: Install Zorin OS.
    08.02.2023 - 2 Comments
    Like Ubuntu and Linux Mint, Zorin OS is very easy to install and allows you to configure distribution on virtual machines through VirtualBox. If you create a bootable USB, even a direct USB installation is possible. Immediately after…
  • Icon-Slicer is a utility for generating icon themes and libXcursor cursor themes.
    17.04.2013 - 0 Comments
    Icon-slicer is a utility for generating icon themes and libXcursor cursor themes. The inputs to icon-slicer are conceptually:   A) A set of multi-layer images, one for each size. B) A XML theme description file Each image contains…

Recent Posts

Recent Posts Widget

Popular Posts

Labels

Archive

page counter follow us in feedly
 
Copyright © 2014 Linuxlandit & The Conqueror Penguin
-->