Thanks to visit codestin.com
Credit goes to github.com

Skip to content

try to improve PyQt4 downgrade #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions winpython/qt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@

import os

# we shall respect QT_API is set
try:
#be friendly with Pyqt5
are_you_here = __import__('PyQt5')
os.environ.setdefault('QT_API','pyqt5')
are_you_set = os.environ['QT_API']
except:
os.environ.setdefault('QT_API', 'pyqt')
try:
# be friendly with Pyqt5
are_you_here = __import__('PyQt5')
# this standard test (for everybody) may not work for WinPython, so...
from PyQt5.QtCore import PYQT_VERSION_STR as __version__

os.environ.setdefault('QT_API','pyqt5')
except:
os.environ.setdefault('QT_API', 'pyqt')

assert os.environ['QT_API'] in ('pyqt5', 'pyqt', 'pyside')
assert os.environ['QT_API'] in ('pyqt5', 'pyqt', 'pyside', 'pyside2')

API = os.environ['QT_API']
API_NAME = {'pyqt5': 'PyQt5', 'pyqt': 'PyQt4', 'pyside': 'PySide'}[API]
API_NAME = {'pyqt5': 'PyQt5', 'pyqt': 'PyQt4', 'pyside': 'PySide',
'pyside2': 'PySide', 'pyqt4': 'PyQt4'}[API]

PYQT5 = False

Expand Down