HowTo: Scale Qt application KeePassXC
If you have a notebook with WQHD-display the scaling of Qt applications could be negatively affected. E.g. the KeepassXC icons and text could be rendered so large that KeePassXC is not usable and there aren't settings in the application for downscaling.
The scaling of virtualbox, vlc and zoom wasn't an issue, therefore this fix is only for KeepassXC. The application was installed with snap, but the principle is the same when installed differently. Copy your
keepassxc_keepassxc.desktop file in
~/.local/share/applications. Then change the line with
Exec and add your Qt scaling parameters. With
. Now it is also possible to add your own scale factors with
QT_SCREEN_SCALE_FACTORS=0.9, but that wasn't necessary in this case.
[Desktop Entry] ... # Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/keepassxc_keepassxc.desktop /snap/bin/keepassxc %f Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/keepassxc_keepassxc.desktop QT_AUTO_SCREEN_SCALE_FACTOR=0 /snap/bin/keepassxc %f ...
To test your factors you can use your notebook with an external monitor and start KeepassXC or other Qt applications from your terminal:
$ QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCREEN_SCALE_FACTORS=0.9 keepassxc
If you are using wayland (in combination with fractional scaling) another possibility might be
qt5ct package and add a configuration for
~/.config/environment.d/10-qt.conf) with the Qt theme you want:
QT_QPA_PLATFORMTHEME="qt5ct" # QT_QPA_PLATFORM="xcb" for X11
You can use the theme in combination with the aforementioned scaling factors.