Skip to content

Commit ff32cc7

Browse files
story645tacaswell
authored andcommitted
Backport PR #17640: More qt fractional DPI fixes
Merge pull request #17640 from QuLogic/more-pyqt5-fixes More qt fractional DPI fixes
1 parent c12c4ff commit ff32cc7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from . import qt_compat
1919
from .qt_compat import (
2020
QtCore, QtGui, QtWidgets, _isdeleted, _getSaveFileName,
21-
is_pyqt5, __version__, QT_API,
21+
is_pyqt5, __version__, QT_API, _setDevicePixelRatioF,
2222
_devicePixelRatioF)
2323

2424

@@ -681,7 +681,7 @@ def _icon(self, name, color=None):
681681
if is_pyqt5():
682682
name = name.replace('.png', '_large.png')
683683
pm = QtGui.QPixmap(os.path.join(self.basedir, name))
684-
qt_compat._setDevicePixelRatioF(pm, _devicePixelRatioF(self))
684+
_setDevicePixelRatioF(pm, _devicePixelRatioF(self))
685685
if color is not None:
686686
mask = pm.createMaskFromColor(QtGui.QColor('black'),
687687
QtCore.Qt.MaskOutColor)

lib/matplotlib/backends/qt_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,6 @@ def _setDevicePixelRatioF(obj, val):
205205
if hasattr(obj, 'setDevicePixelRatioF'):
206206
# Not available on Qt<5.6
207207
obj.setDevicePixelRatioF(val)
208-
if hasattr(obj, 'setDevicePixelRatio'):
208+
elif hasattr(obj, 'setDevicePixelRatio'):
209209
# Not available on Qt4 or some older Qt5.
210210
obj.setDevicePixelRatio(val)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy