else: use_pyqt5 = False except ImportError: use_pyqt5 = False
elif gui_toolkit == 'qt4': use_pyqt5 = False else: use_pyqt5 = True if not qt5_backend_available: raise Exception( 'Qt5 was forced but matplotlib Qt5Agg backend is not availble')
matplotlib.use('Qt5Agg')
return qw.QFileDialog.getSaveFileName(*args, **kwargs)[0]
return self.find(key)
else: if matplotlib.get_backend().find('Qt5') != -1: # noqa matplotlib.use('Qt4Agg')
import PyQt4 as PyQt from PyQt4 import Qt from PyQt4 import QtCore as qc from PyQt4 import QtGui as qg qw = qg from PyQt4 import QtNetwork as qn from PyQt4 import QtOpenGL as qgl from PyQt4 import QtSvg as qsvg qprint = qg QSortFilterProxyModel = qg.QSortFilterProxyModel QItemSelectionModel = qg.QItemSelectionModel QItemSelection = qg.QItemSelection
getSaveFileName = qw.QFileDialog.getSaveFileName
class QPixmapCache(qg.QPixmapCache): def cached(self, key): pixmap = qg.QPixmap() found = self.find(key, pixmap) if found: return pixmap return found
except AttributeError: def vers(s): return tuple(s.split('.'))
# Application attribute has to be set for QWebView |