Show More
@@ -3,12 +3,16 b'' | |||
|
3 | 3 | |
|
4 | 4 | import os |
|
5 | 5 | |
|
6 | # Available APIs. | |
|
7 | QT_API_PYQT = 'pyqt' | |
|
8 | QT_API_PYSIDE = 'pyside' | |
|
9 | ||
|
6 | 10 | # Use PyQt by default until PySide is stable. |
|
7 |
|
|
|
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 | 14 | # For PySide compatibility, use the new string API that automatically |
|
11 |
# converts QStrings to |
|
|
15 | # converts QStrings to Unicode Python strings. | |
|
12 | 16 | import sip |
|
13 | 17 | sip.setapi('QString', 2) |
|
14 | 18 | |
@@ -18,5 +22,8 b" if qt_api == 'pyqt':" | |||
|
18 | 22 | QtCore.Signal = QtCore.pyqtSignal |
|
19 | 23 | QtCore.Slot = QtCore.pyqtSlot |
|
20 | 24 | |
|
21 | else: | |
|
25 | elif QT_API == QT_API_PYSIDE: | |
|
22 | 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