OpenPype icon indicating copy to clipboard operation
OpenPype copied to clipboard

GUi scaling with hires displays

Open mkolar opened this issue 5 years ago • 13 comments

Describe the bug All of our GUIs don't scale correctly on high-resolution monitors. The text gets so small, that It's pretty much unusable. For me in particular it's happening on 4k 15 inch laptop.

To Reproduce Run Pype on 4k monitor and squint your eyes.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots image

Desktop:

  • OS: windows

mkolar avatar Nov 11 '20 21:11 mkolar

Theres a whole chat about this some time ago in the discord channel. I found some good resources there. Also I use this for the moment:

Set env var: QT_AUTO_SCREEN_SCALE_FACTOR = 1

Which has solved most issues on my 4k laptop screen with Pype UI.

FuzzkingCool avatar Nov 13 '20 00:11 FuzzkingCool

Setting globally variable QT_AUTO_SCREEN_SCALE_FACTOR = 1 is one possible solution.

  • That has no affect in Maya. Maya's gui itself works fine but widgets don't.
  • Nuke (tested v11.2v2) on the other hand does not support 4k at all, I think it is impossible to work in nuke and having 4k resolution at the same time.
    • setting the environment in Nuke makes it "closer" how it should look but breaks node graph and viewer
  • not sure how that would affect other host with qt like houdini or

Conclusion

To "fix" tray and non-python hosts it is possible to do and it's easy (with or without the environment). In python +qt hosts like Maya it will be harder. To fix (at least) the font size we can change px in stylesheets to pt so it should scale automatically, that requires to find out matching size and then test if it won't break style in any other hosts.

EDITED

I think maya has different stylesheet for each scales as when moved maya opened on 4k monitor to HD, scale won't change. Which is I think due to limitations of old PySide2. So changing font to points should be enough. What is broken are widget sizes as they are hardcoded (in pixels). image

iLLiCiTiT avatar Nov 17 '20 21:11 iLLiCiTiT

@karmakat i know about https://doc.qt.io/qt-5/highdpi.html I've read it many times. But that's not in maya or nuke (don't know if houdini, resolve, et.c have it).

iLLiCiTiT avatar Nov 17 '20 22:11 iLLiCiTiT

Hi, in Nuke, the QT_AUTO_SCREEN_SCALE_FACTOR is working for 12.1 and up (win and linux, mac is special...) I am not sure if it works with earlier versions hth

jrsndl avatar Nov 24 '20 09:11 jrsndl

I am not sure if it works with earlier versions

Good to know that at least from Nuke 12 it works :) In Nuke 11 are viewer and node graph broken.

iLLiCiTiT avatar Nov 24 '20 10:11 iLLiCiTiT

"QT_AUTO_SCREEN_SCALE_FACTOR": "1" is working reasonably well for now. I'll leave this open on low priority for now, so we can potentially gather more problem in various hosts, but the immediate problem of pulling my hair out is solved ;)

mkolar avatar Dec 02 '20 14:12 mkolar

fixed for now with "QT_AUTO_SCREEN_SCALE_FACTOR": "1" variable in 3.0

mkolar avatar Jun 01 '21 13:06 mkolar

This is unfortunately still an issue:

image

on high dpi display

image

on "standard" HD.

antirotor avatar Nov 15 '23 10:11 antirotor

@antirotor could you report what Qt version you checked with? And is this Windows?

Is this standalone loader? or using inside a particular host (and thus possibly using a different Qt version and/or different Qt vars from the host)

BigRoy avatar Nov 15 '23 11:11 BigRoy

This is Maya 2024 on Windows, Qt from Maya - 5.15.2, on 3200x2000 display set with 200% scaling and 1920x1200 set with 100%

antirotor avatar Nov 15 '23 13:11 antirotor

This is Maya 2024 on Windows, Qt from Maya - 5.15.2, on 3200x2000 display set with 200% scaling and 1920x1200 set with 100%

Can you reproduce the issue in standalone loader from Tray? It might be Maya-specific

BigRoy avatar Nov 15 '23 13:11 BigRoy

standalone tools like tray publisher and loader are OK, just Maya and Max so far. Nuke works fine too. We are setting:

QT_API: pyside2
QT_AUTO_SCREEN_SCALE_FACTOR: 1
QT_D3DCREATE_MULTITHREADED: 1
QT_ENABLE_HIGHDPI_SCALING: 0
QT_MAC_DONT_OVERRIDE_CTRL_LMB: 1
QT_PREFERRED_BINDING: PySide2

"vanilla" maya has just:

QT_D3DCREATE_MULTITHREADED: 1
QT_ENABLE_HIGHDPI_SCALING: 0
QT_MAC_DONT_OVERRIDE_CTRL_LMB: 1

antirotor avatar Nov 15 '23 13:11 antirotor