High DPI and AppImage format
-
Hi all,
I encountered some odd behavior when using an AppImage of a Qt5 application. In the app, before the creation of QApplication, I set
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling)
. This works all fine and dandy when compiling and running normally on a high DPI screen. However, once packed in an AppImage, the UI elements look all tiny and squished, no scaling to take the high DPI into account was done. However, it I set the environment variableQT_AUTO_SCREEN_SCALE_FACTOR=1
before running the AppImage, it all looks good again. According to the documentation aboutQt::AA_EnableHighDpiScaling
:This corresponds to setting the QT_AUTO_SCREEN_SCALE_FACTOR environment variable to 1.
Has anybody else seen this before? Does anyone know of a way to ensure the AppImage respects the
Qt::AA_EnabledHighDpiScaling
attribute?Thanks in advance
-
Hi all,
I encountered some odd behavior when using an AppImage of a Qt5 application. In the app, before the creation of QApplication, I set
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling)
. This works all fine and dandy when compiling and running normally on a high DPI screen. However, once packed in an AppImage, the UI elements look all tiny and squished, no scaling to take the high DPI into account was done. However, it I set the environment variableQT_AUTO_SCREEN_SCALE_FACTOR=1
before running the AppImage, it all looks good again. According to the documentation aboutQt::AA_EnableHighDpiScaling
:This corresponds to setting the QT_AUTO_SCREEN_SCALE_FACTOR environment variable to 1.
Has anybody else seen this before? Does anyone know of a way to ensure the AppImage respects the
Qt::AA_EnabledHighDpiScaling
attribute?Thanks in advance
@aran said in High DPI and AppImage format:
AppImage
I would check the Qt Issue tracker for related issues.
-
As a simple workaround you could have a small script inside your AppImage which first sets the environment variable and then launches your actual app. The AppImage then needs to be configured to launch the script instead. At least, this fixes the user experience.
-
Well, as it turns out there were some environment variables set that caused the highdpi scaling to be disabled. I must have set them at some point, though I can't recall when or why...
Thanks @Asperamanca and @SimonSchroeder for your input!
-