Fix High Dpi Support. Works now under Windows and KDE/Plasma.#392
Fix High Dpi Support. Works now under Windows and KDE/Plasma.#392annejan merged 1 commit intoIJHack:masterfrom
Conversation
Commit 4a53082 was incomplete... Qts scaling environment variables shall never be changed by application. That way the user hasn't any chance to fix things himself. With setting QT_AUTO_SCREEN_SCALE_FACTOR to 1 QtPass does not work under KDE/Plasma and cannot even be fixed by setting Qts scaling environment variables.
|
I suggest this code: #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#else
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
#endif |
|
@FiloSpaTeam Why. The only reason can be that Qt 5.6s HighDPI is broken. By forcing the QT_AUTO_SCALE_FACTOR environment variable to a fixed value you will break it even more, because it is not possible anymore to use the variable outside of QtPass to fix the behavior on some platform where HighDPI misbehaves. So I can only repeat: It is better to never change those environment variables inside of the program. |
|
This is introduced in Qt 5.6 and Debian uses Qt 5.2/3 so they cannot compile. |
|
@FiloSpaTeam With Qt before 5.6 HighDPI is broken anyways. For distributions using those old version I would expect that they patch it themself. I think they already have many other patches of this type inside of their packages and HighDPI still doesn't work completely right anyways. |
Codecov Report
@@ Coverage Diff @@
## master #392 +/- ##
=========================================
+ Coverage 6.49% 6.49% +<.01%
=========================================
Files 39 39
Lines 2557 2556 -1
=========================================
Hits 166 166
+ Misses 2391 2390 -1
Continue to review full report at Codecov.
|
Commit 4a53082 was incomplete...
Qts scaling environment variables shall never be changed by application.
That way the user hasn't any chance to fix things himself. With setting
QT_AUTO_SCREEN_SCALE_FACTOR to 1 QtPass does not work under KDE/Plasma
and cannot even be fixed by setting Qts scaling environment variables.