New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix High Dpi Support. Works now under Windows and KDE/Plasma. #392

Merged
merged 1 commit into from May 12, 2018

Conversation

Projects
None yet
4 participants
@hgraeber
Contributor

hgraeber commented May 11, 2018

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.

Fix High Dpi Support. Works now under Windows ande KDE/Plasma.
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.

@hgraeber hgraeber changed the title from Fix High Dpi Support. Works now under Windows ande KDE/Plasma. to Fix High Dpi Support. Works now under Windows and KDE/Plasma. May 11, 2018

@FiloSpaTeam

This comment has been minimized.

Contributor

FiloSpaTeam commented May 11, 2018

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
@hgraeber

This comment has been minimized.

Contributor

hgraeber commented May 11, 2018

@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.

@FiloSpaTeam

This comment has been minimized.

@FiloSpaTeam

This comment has been minimized.

Contributor

FiloSpaTeam commented May 11, 2018

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

@hgraeber

This comment has been minimized.

Contributor

hgraeber commented May 11, 2018

@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

This comment has been minimized.

codecov bot commented May 11, 2018

Codecov Report

Merging #392 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            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% <ø> (ø) ⬆️

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.

@coveralls

This comment has been minimized.

coveralls commented May 11, 2018

Coverage Status

Coverage remained the same at 6.422% when pulling 59adb7c on hgraeber:master into 3f6f753 on IJHack:master.

@annejan annejan merged commit 4ad1e55 into IJHack:master May 12, 2018

6 checks passed

CodeFactor No issues found.
Details
codecov/patch Coverage not affected when comparing 3f6f753...59adb7c
Details
codecov/project 6.49% (+<.01%) compared to 3f6f753
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
linthub Linthub has cleared the pull request, no code style suggestions found.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment