Does anyone know a workaround to automatically scale Qt widgets on high density pixel monitors running Maya on Windows? Right now the widget is 1:1, making it look half the size it is suppose to. (Linux and Mac does the job with no extra setting).
This is what it's suppose to look:
This is what it looks:
I appreciate if anyone has experienced this issue and knows the solution.
http://doc.qt.io/qt-5/highdpi.html
This page has a bunch of info that could help you with high DPI. You might want to look into the QT_AUTO_SCREEN_SCALE_FACTOR and Qt::AA_EnableHighDpiScaling methods.
I have a toolbox UI that was getting squished really small on a 4k monitor and tried to use these but was unsuccessful. I was probably doing something wrong in my code. I was already planning on re-doing the whole UI in Designer to have better Layouts, and better min/max stretch values. I did this instead. This wound up fixing my UI so that it works for either 1080p or 4k.
Tks, I've tried the instruction on this link a few months ago, but it didn't work at all. Plus, that seems to be only for Qt 5.6 or later, I need to support Maya 2014 and newer, so I expect there is a solution for those without having to hard code the widget scaling.
Unfortunately Qt Designer is not an option for me, as most of the widgets are dynamic. I haven't tested creating the main parent widget in Qt Designer and dynamically build the children widgets, do you think that worth a try?
Not really. The only half-solution was suggested in this post (I hope you can read it)
https://www.facebook.com/groups/2005754612821908/permalink/2039689269428442/
Hi,
I think I have the same problem. 🙂
I'm working on some scripts with Qt.py and the Qt autoscaling is not working.
If I start the app in standalone mode (direct with external python) the Qt variables are working and it is scaling correctly.
Tried the following:
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" # os.environ["QT_SCALE_FACTOR"] = "1.5" QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
But I think its only working in external/standalone because of the env variables (not used through Maya?)?
Is there any workaround for the High-DPI scaling of custom Maya scripts with Qt?
Of course, we can query the current Maya scaling and change the width, height, fontsize etc. but...... I think this is a neverending story for bigger scripts/Qt-Layouts. 😕
Software:
Maya 2018.5
Windows 10, Latest
p.s.:
https://www.facebook.com/groups/2005754612821908/permalink/2039689269428442/
The link is not working
hi I've been investigating this issue as well.
This post was useful - thanks for sharing, i had some interesting findings when playing with:
QT_AUTO_SCREEN_SCALE_FACTOR
I started a thread here https://forums.autodesk.com/t5/maya-programming/maya-2018-qt-tooling-4k-support/td-p/8567322 to collate my findings.