8000 Fix AttributeError: 'QPixmap' object has no attribute 'setDevicePixel… · matplotlib/matplotlib@d2a0a0b · GitHub
[go: up one dir, main page]

Skip to content

Commit d2a0a0b

Browse files
authored
Fix AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'
1 parent 02e89e6 commit d2a0a0b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ def _icon(self, name):
588588
if is_pyqt5():
589589
name = name.replace('.png', '_large.png')
590590
pm = QtGui.QPixmap(os.path.join(self.basedir, name))
591-
pm.setDevicePixelRatio(self.canvas._dpi_ratio)
591+
if hasattr(pm, 'setDevicePixelRatio'):
592+
pm.setDevicePixelRatio(self.canvas._dpi_ratio)
592593
return QtGui.QIcon(pm)
593594

594595
def _init_toolbar(self):

0 commit comments

Comments
 (0)
0