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

Skip to content

Commit 5a6826f

Browse files
committed
MNT: Always use scaling with Qt if available
1 parent 39b86d6 commit 5a6826f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ def _create_qApp():
149149
qApp = app
150150

151151
if is_pyqt5():
152-
qApp.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
152+
try:
153+
qApp.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
154+
qApp.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
155+
except AttributeError:
156+
pass
153157

154158

155159
class Show(ShowBase):
@@ -159,6 +163,7 @@ def mainloop(self):
159163
global qApp
160164
qApp.exec_()
161165

166+
162167
show = Show()
163168

164169

0 commit comments

Comments
 (0)