Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

qt_for_kernel: use matplotlib rcParams to decide between PyQt4 and Py…

…Side

This is a companion to a possible change in mpl, adding
rcParams['backend.qt4'], but should work as well with earlier
mpl versions.
(There is still a problem with mpl in the ipython console when
PySide is selected.)
  • Loading branch information...
commit 31776325b978fa6ca97f3f09bdc10d45befd87c9 1 parent b74d704
@efiring authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 IPython/external/qt_for_kernel.py
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
Please sign in to comment.
Something went wrong with that request. Please try again.