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

Skip to content

Commit 8244201

Browse files
authored
Merge pull request #18876 from QuLogic/fractional-hidpi-qt
MNT: Support fully-fractional HiDPI added in Qt 5.14.
2 parents 4748f6f + 64be0e4 commit 8244201

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ def _create_qApp():
119119
QtCore.Qt.AA_EnableHighDpiScaling)
120120
except AttributeError: # Attribute only exists for Qt>=5.6.
121121
pass
122+
try:
123+
QtWidgets.QApplication.setHighDpiScaleFactorRoundingPolicy(
124+
QtCore.Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)
125+
except AttributeError: # Added in Qt>=5.14.
126+
pass
122127
qApp = QtWidgets.QApplication(["matplotlib"])
123128
qApp.lastWindowClosed.connect(qApp.quit)
124129
cbook._setup_new_guiapp()

0 commit comments

Comments
 (0)