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

Skip to content

Commit 4daacdd

Browse files
committed
Update qt_compat.py
Add PySide
1 parent 9d5d884 commit 4daacdd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/matplotlib/backends/qt_compat.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
# A different backend was specified, but we still got here because a Qt
3434
# related file was imported. This is allowed, so lets try and guess
3535
# what we should be using.
36-
if "PyQt4" in sys.modules:
37-
# PyQt4 is actually used.
36+
if "PyQt4" in sys.modules or "PySide" in sys.modules:
37+
# PyQt4 or PySide is actually used.
3838
QT_RC_MAJOR_VERSION = 4
3939
else:
40-
# This is a fallback
40+
# This is a fallback: PyQt5
4141
QT_RC_MAJOR_VERSION = 5
4242

4343
QT_API = None
@@ -64,11 +64,11 @@
6464
# A different backend was specified, but we still got here because a Qt
6565
# related file was imported. This is allowed, so lets try and guess
6666
# what we should be using.
67-
if "PyQt4" in sys.modules:
68-
# PyQt4 is actually used.
67+
if "PyQt4" in sys.modules or "PySide" in sys.modules:
68+
# PyQt4 or PySide is actually used.
6969
QT_API = rcParams['backend.qt4']
7070
else:
71-
# This is a fallback
71+
# This is a fallback: PyQt5
7272
QT_API = rcParams['backend.qt5']
7373

7474
# We will define an appropriate wrapper for the differing versions

0 commit comments

Comments
 (0)