qt.conf with pyside6-deploy? Or: pixel-perfect QGraphicsView ignoring scaling

48 Views Asked by At

My application needs a screen-pixel-perfect display in its QGraphicsView regardless of the user's set application scaling. After building one-file with pyside6-deploy, I tried to set the scaling method through the file properties (properties -> compatibility -> change high DPI settings -> check scaling override, set to "Application"). This gives me a warning:

qt.qpa.window: SetProcessDpiAwarenessContext() failed: The operation completed successfully.

Qt's default DPI awareness context is `DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2`. If you know what you are doing, you can overwrite this default using qt.conf (https://doc.qt.io/qt-6/highdpi.html#configuring-windows).

That provided link says that you can use a qt.conf alongside the executable path, i.e. QCoreApplication::applicationDirPath() + QDir::separator() + "qt.conf". Checking this path in the program shows that it's in a temporary folder. How would I be able to bundle a qt.conf file in a one-file built program?

Alternative solution: make the QGraphicsView specifically ignore scaling.

0

There are 0 best solutions below