Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Qt Widgets and High Dpi on 4k monitor (Windows)

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
4302 Views, 7 Replies

Qt Widgets and High Dpi on 4k monitor (Windows)

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:
animbot_normal.png

 

This is what it looks:
animBot_small.jpg

 

I appreciate if anyone has experienced this issue and knows the solution.

Tags (1)
7 REPLIES 7
Message 2 of 8
gilleybaba
in reply to: Anonymous

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.

Message 3 of 8
Anonymous
in reply to: gilleybaba

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?

 

Message 4 of 8
Francois.Devic
in reply to: Anonymous

Hello!
Did you manage to find a solution?

 

Thanks

Message 5 of 8
Anonymous
in reply to: Francois.Devic

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/


Message 6 of 8
Francois.Devic
in reply to: Anonymous

Thanks!
We are going to check that.

Message 7 of 8
neslane
in reply to: Francois.Devic

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

 

Message 8 of 8
joe.deuchar
in reply to: neslane

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. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report