Skip to content

Commit

Permalink
BUG: Fix bug with PyQt6 HiDPI (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Apr 25, 2024
1 parent 52d622b commit 7508913
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 7508913

Please sign in to comment.