2

I have a problem with QT applications (i.e. picard or masterpdfeditor) under GNOME: their interface looks tiny.
Instead, GTK application looks good.

I would like a global solution which will work across all applications, not a per-application fix.

I don't know exactly where the issue begin (is it a QT5 issue or a GNOME issue?) but I'd like to have a bigger interface. How can I do it?

I have already tried with a trick explained here but it works partially:

  • if I launch the apps directly from the terminal, by appending the right variable e.g. QT_SCALE_FACTOR=1.35 picard, the trick works!
  • while if I launch them from the menu (gnome-shell), the exported variable is completely ignored.

Is there a way to fix it?

I have a laptop connected with an external FullHD 24" monitor. I'm on Arch Linux x86_64 and Gnome 3.28/3.30.

5

According to the Archlinux Wiki:

Since Qt 5.6, Qt 5 applications can be instructed to honor screen DPI by setting the QT_AUTO_SCREEN_SCALE_FACTOR environment variable.

So, you just need to edit ~/.profile or ~/.bash_profile and add this line to export the correct environment variable like this :

export QT_AUTO_SCREEN_SCALE_FACTOR=1

I've tried with KeepassXC under ubuntu 18.04 successfully.

  • 1
    unfortunately, doesn't work for me! – mattia.b89 May 13 '18 at 12:45
  • It works (Manjaro GNOME) but all icons are pixelated and menuitems height is too big. – Alexander Logger Aug 28 '18 at 6:34
  • if QT_AUTO_SCREEN_SCALE_FACTOR=1 does not work, the issue may be related to that gnome-settings-daemon sets Xft.dpi to a non-integer. Try xrdb -query | grep dpi to check this. – Fang Hung-chien 2 days ago
0

Don't use QT_AUTO_SCREEN_SCALE_FACTOR. Based on my experience, this seems to cause some weird default scaling.

Use QT_SCALE_FACTOR=1.5 instead.
(or whatever size you want, supports fractional scaling.)

Works perfectly fine on a Dell with 4K display.

You can also add this to the desktop launcher:

Exec=env QT_SCALE_FACTOR=1.5 /path/to/app

Source: It works on my machine with 4k display.

  • -1: You talk about per-application solution and it already works as stated in OP. I'm looking for a global fix. – mattia.b89 Dec 8 '18 at 13:24
  • @mattia.b89 Please edit your original post to indicate you're looking for a global fix for all applications, if that is the case. This solution answers your original question, as it was framed, which reads: "if I launch the apps directly from the terminal [... it works] while if I launch them from the menu (gnome-shell), the exported variable is completely ignored. Is there a way to fix it?" (ie: Works from terminal, doesn't work from launcher, how to fix it?) This indeed is not a global all-applications solution, but solves the launcher issue, as indicated by the question. – emf Dec 19 '18 at 16:36
  • please read thoroughly my OP. Especially, link to archwiki page... – mattia.b89 Dec 19 '18 at 17:36
  • As stated, the "global fix" was not indicated anywhere in the original post. I've edited and fixed your question for clarity. – emf Dec 20 '18 at 18:27
0

I had some issues getting Viber to run properly on my HiDPI display. By default Viber would be massive to the point where I had to full-screen it in order to use it.

The solution was to disable automatic scaling (QT_AUTO_SCREEN_SCALE_FACTOR=0) and set a manual value (QT_SCALE_FACTOR=1.5).

I modified the Exec= line in /usr/share/applications/viber.desktop to this:

Exec=/usr/bin/env QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=1.5 /usr/bin/viber %u

Now it looks perfect. Your mileage may vary based on the size of your display, you might want to set QT_SCALE_FACTOR to 2 or even more.

I found it strange that I had to explicitly disable automatic scaling, as most of the answers I've found online says you have to enable it to fix your scaling issues. I guess it has become the default in newer versions of QT (?)

(I know this doesn't strictly answer the asked question but I thought it'd be useful to someone.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.