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

Skip to content

Commit 969513e

Browse files
authored
Merge pull request #17469 from anntzer/qv
Use qVersion, not QT_VERSION_STR -- the latter doesn't exist in PySide2.
2 parents 46936d7 + 897bc57 commit 969513e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

doc/api/api_changes_3.3/deprecations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ The ``cbid`` and ``locator`` attribute are deprecated. Use
545545
``qt_compat.is_pyqt5``
546546
~~~~~~~~~~~~~~~~~~~~~~
547547
This function is deprecated in prevision of the future release of PyQt6. The
548-
Qt version can be checked using ``QtCore.QT_VERSION_STR``.
548+
Qt version can be checked using ``QtCore.qVersion()``.
549549

550550
Reordering of parameters by `.Artist.set`
551551
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

examples/user_interfaces/embedding_in_qt_sgskip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import numpy as np
1616

1717
from matplotlib.backends.qt_compat import QtCore, QtWidgets
18-
if QtCore.QT_VERSION_STR >= "5.":
18+
if QtCore.qVersion() >= "5.":
1919
from matplotlib.backends.backend_qt5agg import (
2020
FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
2121
else:

lib/matplotlib/backends/backend_qt5.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _create_qApp():
105105
app = QtWidgets.QApplication.instance()
106106
if app is None:
107107
# check for DISPLAY env variable on X11 build of Qt
108-
if QtCore.QT_VERSION_STR >= "5.":
108+
if QtCore.qVersion() >= "5.":
109109
try:
110110
importlib.import_module(
111111
# i.e. PyQt5.QtX11Extras or PySide2.QtX11Extras.
@@ -331,7 +331,7 @@ def mouseReleaseEvent(self, event):
331331
FigureCanvasBase.button_release_event(self, x, y, button,
332332
guiEvent=event)
333333

334-
if QtCore.QT_VERSION_STR >= "5.":
334+
if QtCore.qVersion() >= "5.":
335335
def wheelEvent(self, event):
336336
x, y = self.mouseEventCoords(event)
337337
# from QWheelEvent::delta doc
@@ -688,7 +688,7 @@ def basedir(self):
688688
return str(cbook._get_data_path('images'))
689689

690690
def _icon(self, name):
691-
if QtCore.QT_VERSION_STR >= '5.':
691+
if QtCore.qVersion() >= '5.':
692692
name = name.replace('.png', '_large.png')
693693
pm = QtGui.QPixmap(str(cbook._get_data_path('images', name)))
694694
qt_compat._setDevicePixelRatio(pm, qt_compat._devicePixelRatio(self))

lib/matplotlib/backends/qt_compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _isdeleted(obj): return not shiboken2.isValid(obj)
8585
raise ValueError("Unexpected value for the 'backend.qt5' rcparam")
8686
_getSaveFileName = QtWidgets.QFileDialog.getSaveFileName
8787

88-
@mpl.cbook.deprecated("3.3", alternative="QtCore.QT_VERSION_STR")
88+
@mpl.cbook.deprecated("3.3", alternative="QtCore.qVersion()")
8989
def is_pyqt5():
9090
return True
9191

@@ -145,7 +145,7 @@ def _isdeleted(obj): return not shiboken.isValid(obj)
145145
raise ValueError("Unexpected value for the 'backend.qt4' rcparam")
146146
QtWidgets = QtGui
147147

148-
@mpl.cbook.deprecated("3.3", alternative="QtCore.QT_VERSION_STR")
148+
@mpl.cbook.deprecated("3.3", alternative="QtCore.qVersion()")
149149
def is_pyqt5():
150150
return False
151151

0 commit comments

Comments
 (0)