##// END OF EJS Templates
Clean up in Qt API switcher.
epatters -
Show More
@@ -3,12 +3,16 b''
3
3
4 import os
4 import os
5
5
6 # Available APIs.
7 QT_API_PYQT = 'pyqt'
8 QT_API_PYSIDE = 'pyside'
9
6 # Use PyQt by default until PySide is stable.
10 # Use PyQt by default until PySide is stable.
7 qt_api = os.environ.get('QT_API', 'pyqt')
11 QT_API = os.environ.get('QT_API', QT_API_PYQT)
8
12
9 if qt_api == 'pyqt':
13 if QT_API == QT_API_PYQT:
10 # For PySide compatibility, use the new string API that automatically
14 # For PySide compatibility, use the new string API that automatically
11 # converts QStrings to unicode Python strings.
15 # converts QStrings to Unicode Python strings.
12 import sip
16 import sip
13 sip.setapi('QString', 2)
17 sip.setapi('QString', 2)
14
18
@@ -18,5 +22,8 b" if qt_api == 'pyqt':"
18 QtCore.Signal = QtCore.pyqtSignal
22 QtCore.Signal = QtCore.pyqtSignal
19 QtCore.Slot = QtCore.pyqtSlot
23 QtCore.Slot = QtCore.pyqtSlot
20
24
21 else:
25 elif QT_API == QT_API_PYSIDE:
22 from PySide import QtCore, QtGui, QtSvg
26 from PySide import QtCore, QtGui, QtSvg
27
28 else:
29 raise RuntimeError('Invalid Qt API "%s"' % QT_API)
General Comments 0
You need to be logged in to leave comments. Login now