##// END OF EJS Templates
version check Qt bindings in external.qt...
MinRK -
Show More
@@ -25,14 +25,21 b" QT_API = os.environ.get('QT_API')"
25 if QT_API is None:
25 if QT_API is None:
26 try:
26 try:
27 import PySide
27 import PySide
28 if PySide.__version__ < '1.0.3':
29 # old PySide, fallback on PyQt
30 raise ImportError
28 QT_API = QT_API_PYSIDE
31 QT_API = QT_API_PYSIDE
29 except ImportError:
32 except ImportError:
30 try:
33 try:
31 prepare_pyqt4()
34 prepare_pyqt4()
32 import PyQt4
35 import PyQt4
36 from PyQt4 import QtCore
37 if QtCore.PYQT_VERSION_STR < '4.7':
38 # PyQt 4.6 has issues with null strings returning as None
39 raise ImportError
33 QT_API = QT_API_PYQT
40 QT_API = QT_API_PYQT
34 except ImportError:
41 except ImportError:
35 raise ImportError('Cannot import PySide or PyQt4')
42 raise ImportError('Cannot import PySide >= 1.0.3 or PyQt4 >= 4.7')
36
43
37 elif QT_API == QT_API_PYQT:
44 elif QT_API == QT_API_PYQT:
38 # Note: This must be called *before* PyQt4 is imported.
45 # Note: This must be called *before* PyQt4 is imported.
@@ -41,12 +48,17 b' elif QT_API == QT_API_PYQT:'
41 # Now peform the imports.
48 # Now peform the imports.
42 if QT_API == QT_API_PYQT:
49 if QT_API == QT_API_PYQT:
43 from PyQt4 import QtCore, QtGui, QtSvg
50 from PyQt4 import QtCore, QtGui, QtSvg
51 if QtCore.PYQT_VERSION_STR < '4.7':
52 raise ImportError("IPython requires PyQt4 >= 4.7, found %s"%QtCore.PYQT_VERSION_STR)
44
53
45 # Alias PyQt-specific functions for PySide compatibility.
54 # Alias PyQt-specific functions for PySide compatibility.
46 QtCore.Signal = QtCore.pyqtSignal
55 QtCore.Signal = QtCore.pyqtSignal
47 QtCore.Slot = QtCore.pyqtSlot
56 QtCore.Slot = QtCore.pyqtSlot
48
57
49 elif QT_API == QT_API_PYSIDE:
58 elif QT_API == QT_API_PYSIDE:
59 import PySide
60 if PySide.__version__ < '1.0.3':
61 raise ImportError("IPython requires PySide >= 1.0.3, found %s"%PySide.__version__)
50 from PySide import QtCore, QtGui, QtSvg
62 from PySide import QtCore, QtGui, QtSvg
51
63
52 else:
64 else:
General Comments 0
You need to be logged in to leave comments. Login now