File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010import os
1111
12+ # we shall respect QT_API is set
1213try :
13- #be friendly with Pyqt5
14- are_you_here = __import__ ('PyQt5' )
15- os .environ .setdefault ('QT_API' ,'pyqt5' )
14+ are_you_set = os .environ ['QT_API' ]
1615except :
17- os .environ .setdefault ('QT_API' , 'pyqt' )
16+ try :
17+ # be friendly with Pyqt5
18+ are_you_here = __import__ ('PyQt5' )
19+ # this standard test (for everybody) may not work for WinPython, so...
20+ from PyQt5 .QtCore import PYQT_VERSION_STR as __version__
21+
22+ os .environ .setdefault ('QT_API' ,'pyqt5' )
23+ except :
24+ os .environ .setdefault ('QT_API' , 'pyqt' )
1825
19- assert os .environ ['QT_API' ] in ('pyqt5' , 'pyqt' , 'pyside' )
26+ assert os .environ ['QT_API' ] in ('pyqt5' , 'pyqt' , 'pyside' , 'pyside2' )
2027
2128API = os .environ ['QT_API' ]
22- API_NAME = {'pyqt5' : 'PyQt5' , 'pyqt' : 'PyQt4' , 'pyside' : 'PySide' }[API ]
29+ API_NAME = {'pyqt5' : 'PyQt5' , 'pyqt' : 'PyQt4' , 'pyside' : 'PySide' ,
30+ 'pyside2' : 'PySide' , 'pyqt4' : 'PyQt4' }[API ]
2331
2432PYQT5 = False
2533
You can’t perform that action at this time.
0 commit comments