-
Notifications
You must be signed in to change notification settings - Fork 21
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
Broken axes (misaligned) on dual screen [Bug] #101
Comments
Hi @blupgnup, thank you for raising this issue.
|
Hi @Neverhorst, Thanks for pointing out the QT_ENABLE_HIGHDPI_SCALING and the link with display scaling. Here is the result of some additional tests:
In conclusion, the DLL call, ensure that this is working without user specific action but at the cost of a slightly blurred window (and maybe unwanted side effects). |
Version
Development
What is affected by the bug?
Any GUI that plots graph and display axes when using dual screen computer.
When does the bug occur?
When using qudi-core on a computer with 2 screens of different size, a known bug of PySide2 leads to misaligned axis when plotting a graph.
This is mainly due to Windows HighDPI scaling.
How do we replicate the issue?
Create a GUI that plots a graph using a class inheriting QtWidgets.QMainWindow
Launch qudi on a dual screen computer with 2 screens using different windows display scaling.
Move the GUI on the second screen, the axes will appear completely misaligned although the plot is still ok.
Expected behavior
Axes should remain aligned for a better viewing and especially because, in this case, the data plotted is also not in phase with axes.
Relevant log output
No response
Additional Comments
The following code can fix this issue by making the program "DPI aware".
import platform
import ctypes
if platform.system()=='Windows' and int(platform.release()) >= 8:
ctypes.windll.shcore.SetProcessDpiAwareness(True)
However, it is not possible to use this fix in a qudi module as it needs to run before the main GUI initialization.
Was tested successfully by making this change in src\qudi\core\gui\gui.py
There could also be some more 'proper' way to do it using QTAttribute:
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True)
but this did not work in my case...
In any case, if the proposed solution is acceptable, it would be great to have it integrated into qudi-core to avoid working with a modified version and I think this could benefit many users facing the same problem.
Contact Details
No response
The text was updated successfully, but these errors were encountered: