Skip to content

Commit

Permalink
Add PySide compatibility function for QGLWidget.devicePixelRatioF
Browse files Browse the repository at this point in the history
The call to this function added in change 2070063 broke usdview
when using PySide since this function was added in Qt 5.6. This
change patches in a simplified version of this function to
fix this.

(Internal change: 2070734)
  • Loading branch information
sunyab authored and pixar-oss committed May 26, 2020
1 parent e68fb91 commit e7ff8e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pxr/usdImaging/usdviewq/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def GetPySideModule():
if not hasattr(QtGui.QApplication, 'devicePixelRatio'):
QtGui.QApplication.devicePixelRatio = lambda self: 1

if not hasattr(QtOpenGL.QGLWidget, 'devicePixelRatioF'):
QtOpenGL.QGLWidget.devicePixelRatioF = lambda self: 1.0

if not hasattr(QtWidgets.QHeaderView, 'setSectionResizeMode'):
QtWidgets.QHeaderView.setSectionResizeMode = \
QtWidgets.QHeaderView.setResizeMode
Expand Down

0 comments on commit e7ff8e8

Please sign in to comment.