Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b6e92a

Browse files
committed
Remove redundant pixel ratio compat functions.
1 parent 1fb756e commit 5b6e92a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/matplotlib/backends/qt_compat.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
def _setup_pyqt5():
6969
global QtCore, QtGui, QtWidgets, __version__, is_pyqt5, \
70-
_isdeleted, _devicePixelRatio, _setDevicePixelRatio, _getSaveFileName
70+
_isdeleted, _getSaveFileName
7171

7272
if QT_API == QT_API_PYQT5:
7373
from PyQt5 import QtCore, QtGui, QtWidgets
@@ -89,14 +89,10 @@ def _isdeleted(obj): return not shiboken2.isValid(obj)
8989
def is_pyqt5():
9090
return True
9191

92-
# self.devicePixelRatio() returns 0 in rare cases
93-
def _devicePixelRatio(obj): return obj.devicePixelRatio() or 1
94-
def _setDevicePixelRatio(obj, factor): obj.setDevicePixelRatio(factor)
95-
9692

9793
def _setup_pyqt4():
9894
global QtCore, QtGui, QtWidgets, __version__, is_pyqt5, \
99-
_isdeleted, _devicePixelRatio, _setDevicePixelRatio, _getSaveFileName
95+
_isdeleted, _getSaveFileName
10096

10197
def _setup_pyqt4_internal(api):
10298
global QtCore, QtGui, QtWidgets, \
@@ -149,9 +145,6 @@ def _isdeleted(obj): return not shiboken.isValid(obj)
149145
def is_pyqt5():
150146
return False
151147

152-
def _devicePixelRatio(obj): return 1
153-
def _setDevicePixelRatio(obj, factor): pass
154-
155148

156149
if QT_API in [QT_API_PYQT5, QT_API_PYSIDE2]:
157150
_setup_pyqt5()

0 commit comments

Comments
 (0)