DPI problems between qt-apps and gtk

Hi !

I month ago I got an old MacBookPro 8,1 (2012) and it’s pre-retina so resolution is max 1280x800. Out of the box everything was a bit too big and I reduced dpi but then some qt-apps don’t show properly. I looked in qt5-config-tool but there I get the message that “The QT_QPA_PLATFORMTHEME environment variable is not set (required value: qt5ct).” I have exported this in terminal but It made no difference. The only small temporary fix I have found is to open qt-app in terminal with QT_SCALE_FACTOR_ROUNDING_POLICY=Round.

Anyone who knows a more permanent fix?


Try adding this to /etc/environment (or in a file under /ect/environment.d/):


See also https://wiki.archlinux.org/index.php/environment_variables

Did work partially. Qbittorrent didn’t budge and is still unreadable.
I read that from 4 months ago there is a problem with qbittorrent. It only works with dpi 96. Haven’t found any solution to this. That is a bit big on this screen. I can use the workarround. On my other computers I do not have this problem and I have Openbox on all. It must be that I have to change dpi on this screen to make it useful.


What DE/WM are you using on this mac? Some DEs don’t handle DPI setting properly. Can you check the system DPI setting?

$xdpyinfo | grep -B2 resolution

I alway use Openbox as my primary setup. And this MacBookPro 8,1 (2012) just pre retina is really a wonderful laptop but has a not so flexible screen. (1280x800)
It works but I have to tune down dpi a bit. Qt and especially qbittorrent does not react well to changes in dpi. I have gone down to dpi 82 in appeance but xpydinfo gives 96x96.



added to ~/.profile (~/.zprofile for zsh, ~/.bash_profile for bash)

Highly suggest reading through the above link, there’s settings in there for each DE and toolkit.

Will do!


I read it thru and did export but that didn’t do anything for qbittorrent.
I edited Xrescourses xft.dpi 92 but same result. The only thing I can do is to change dpi to 96 and then open qbittorrent.
I find this strange.


Did you logout and back in?

Try to set it in your X config,

Option "DPI" "92 x 92"

or, from autostart of openbox,

xrandr --dpi 92

Did reboot between every change in config to be sure.


xrandr --dpi 92 did not help.


I use gdm as DM (usually I use Lightdm). Could that have something to do with this?


It would help to know what you actually want scaled as there’s various options for fonts or UI.

At any rate, you should use one of the other options available from the wiki (when I say read I actually mean read & try, not just glance over)

QT_FONT_DPI=96  # scale dpi

QT_SCALE_FACTOR=1.5 # scale fonts only


These can be used to test (without needing to reboot) like so

QT_FONT_DPI=96 qbittorrent

QT_SCALE_FACTOR=1.5 qbittorrent


Whichever works could then be added to some startup file.

I installed qbittorrent and have a 4k screen so I can confirm these do actually work.

Now I have “glanced it over” 2 more times.

QT_FONT_DPI=96 qbittorrent

works and I have tried exporting this in bash_profile, bashrc, Xresources and then in the .desktop file. Nothing made any change.
I tried .xprofile for one more try and that worked!


Good stuff

1 Like

Glad that you got it to work, props to @natemaia @chroot @Head_on_a_Stick

Thanks man!
This one was strange.


Yep, you re welcomed, some stuff are strange on Linux some times, wonder if it had to do with an update .

Don’t think so. I read that many have had this problem with qbittorrent!
I don’t know what is done in qbittorrent but it must be something different there.


1 Like