Skip to content
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

BUG: Fix bug with PyQt6 HiDPI #565

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pyvistaqt/rwi.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,11 @@ def _GetCtrlShift(self, ev):

@staticmethod
def _getPixelRatio():
if PyQtImpl in ["PyQt5", "PySide2", "PySide6"]:
if PyQtImpl in ("PyQt4", "PySide"):
# Qt4 seems not to provide any cross-platform means to get the
# pixel ratio.
return 1.
else:
# Source: https://stackoverflow.com/a/40053864/3388962
pos = QCursor.pos()
for screen in QApplication.screens():
Expand All @@ -535,10 +539,6 @@ def _getPixelRatio():
return screen.devicePixelRatio()
# Should never happen, but try to find a good fallback.
return QApplication.instance().devicePixelRatio()
else:
# Qt4 seems not to provide any cross-platform means to get the
# pixel ratio.
return 1.

def _setEventInformation(self, x, y, ctrl, shift,
key, repeat=0, keysum=None):
Expand Down
Loading