Skip to content

qt_for_kernel: use matplotlib rcParams to decide between PyQt4 and PySide #556

Closed
wants to merge 1 commit into from
View
8 IPython/external/qt_for_kernel.py
@@ -6,7 +6,11 @@
# Older versions of matplotlib do not support PyQt4 v2 APIs or PySide, so we
# cannot go through the preferred mechanism.
matplotlib = sys.modules.get('matplotlib')
-if matplotlib and matplotlib.__version__ <= '1.0.1':
- from PyQt4 import QtCore, QtGui
+if matplotlib:
+ mqt = matplotlib.rcParams.get('backend.qt4', 'PyQt4')
+ if mqt == 'PyQt4':
+ from PyQt4 import QtCore, QtGui
+ else:
+ from PySide import QtCore, QtGui
else:
from IPython.external.qt import QtCore, QtGui
Something went wrong with that request. Please try again.