Closed hgraeber closed 6 years ago
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. Se have not defined a minimal Qt version so we should be compatible
@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.
Merging #392 into master will increase coverage by
<.01%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #392 +/- ##
=========================================
+ Coverage 6.49% 6.49% +<.01%
=========================================
Files 39 39
Lines 2557 2556 -1
=========================================
Hits 166 166
+ Misses 2391 2390 -1
Impacted Files | Coverage Δ | |
---|---|---|
main/main.cpp | 0% <ø> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 3f6f753...59adb7c. Read the comment docs.
Commit 4a530820 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.