Exemplo n.º 1
0
    sys.modules["PySide.uic"] = uic
    matplotlib.rcParams['backend.qt4'] = 'PySide'
    Qt_version = QtCore.__version_info__
else:
    try:
        from PyQt4 import QtGui, QtCore, uic, QtWebKit
        from PyQt4.QtCore import SIGNAL, pyqtSignal as Signal
    except ImportError:
        has_Qt = False

    from PyQt4.QtCore import QT_VERSION_STR
    from PyQt4.Qt import PYQT_VERSION_STR
    from sip import SIP_VERSION_STR
    Qt_version = tuple(int(i) for i in QT_VERSION_STR.split(".")[:3])
    SIP_version = tuple(int(i) for i in SIP_VERSION_STR.split(".")[:3])
    PyQt_version = tuple(int(i) for i in PYQT_VERSION_STR.split(".")[:3])

if has_Qt:
    matplotlib.rcParams['backend'] = 'Qt4Agg'
    import matplotlib.pyplot
    matplotlib.pyplot.switch_backend('Qt4Agg')
    # Dear reader, I apologize for something that ugly !
    # Any cleaner version would be appreciated

    # matplotlib.use('Qt4Agg')
    from matplotlib.backends import backend_qt4 as backend
    from matplotlib import pyplot
    from matplotlib import pylab
else:
    from matplotlib import pyplot
    from matplotlib import pylab
Exemplo n.º 2
0
    sys.modules["PySide.uic"] = uic
    matplotlib.rcParams['backend.qt4'] = 'PySide'
    Qt_version = QtCore.__version_info__
else:
    try:
        from PyQt4 import QtGui, QtCore, uic, QtWebKit
        from PyQt4.QtCore import SIGNAL, pyqtSignal as Signal
    except ImportError:
        has_Qt = False
    else:
        from PyQt4.QtCore import QT_VERSION_STR
        from PyQt4.Qt import PYQT_VERSION_STR
        from sip import SIP_VERSION_STR
        Qt_version = tuple(int(i) for i in QT_VERSION_STR.split(".")[:3])
        SIP_version = tuple(int(i) for i in SIP_VERSION_STR.split(".")[:3])
        PyQt_version = tuple(int(i) for i in PYQT_VERSION_STR.split(".")[:3])

if has_Qt:
    matplotlib.rcParams['backend'] = 'Qt4Agg'
    import matplotlib.pyplot
    matplotlib.pyplot.switch_backend('Qt4Agg')
    # Dear reader, I apologize for something that ugly !
    # Any cleaner version would be appreciated

    # matplotlib.use('Qt4Agg')
    from matplotlib.backends import backend_qt4 as backend
    from matplotlib import pyplot
    from matplotlib import pylab
else:
    from matplotlib import pyplot
    from matplotlib import pylab