-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Enable high DPI scaling on Qt >= 5.6 #3333
Conversation
Could we use a different version comparison that using QTVERSION Should we use the qtpy ones? |
@goanpeca, it requires a bit more code, but I was thinking that too. I'll add a comment to the diff :-) |
@ccordoba12 , or we could do it the way @SylvainCorlay did, # For retina displays on qt5
if hasattr(Qt, 'AA_UseHighDpiPixmaps'):
app.setAttribute(Qt.AA_UseHighDpiPixmaps)
if hasattr(Qt, 'AA_EnableHighDpiScaling'):
app.setAttribute(Qt.AA_EnableHighDpiScaling) |
It doesn't work like that because AA_EnableHighDpiScaling needs to be El 29/07/16 a las 09:49, Gonzalo Peña-Castellanos escribió:
|
# be set before creating the application | ||
#============================================================================== | ||
if QT_VERSION >= 0x050600: | ||
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patstew, we prefer to avoid a comparison with an hex number, so please write this code like
if hasattr(Qt, 'AA_EnableHighDpiScaling'):
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
Sure, on Navigator when I use that the application is already created |
There you go, I've changed it to use hasattr instead. The attribute has no effect if you set it after a QGuiApplication constructor. |
Yes, the Qt docs are quite clear about it: (Look for Qt::AA_EnableHighDpiScaling) El 29/07/16 a las 10:02, Gonzalo Peña-Castellanos escribió:
|
Fixes #2119