Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 90e25ec

Browse filesBrowse files
authored
Merge pull request #14566 from anntzer/enablehighdpiscaling
Move setting of AA_EnableHighDpiScaling before creating QApplication.
2 parents e53cb0e + f008360 commit 90e25ec
Copy full SHA for 90e25ec

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎lib/matplotlib/backends/backend_qt5.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ def _create_qApp():
118118
if display is None or not re.search(r':\d', display):
119119
raise RuntimeError('Invalid DISPLAY variable')
120120

121+
try:
122+
QtWidgets.QApplication.setAttribute(
123+
QtCore.Qt.AA_EnableHighDpiScaling)
124+
except AttributeError: # Attribute only exists for Qt>=5.6.
125+
pass
121126
qApp = QtWidgets.QApplication([b"matplotlib"])
122127
qApp.lastWindowClosed.connect(qApp.quit)
123128
else:
@@ -126,7 +131,6 @@ def _create_qApp():
126131
if is_pyqt5():
127132
try:
128133
qApp.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
129-
qApp.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
130134
except AttributeError:
131135
pass
132136

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.