-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
qt imports fix #5134
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
qt imports fix #5134
Conversation
This fixes an error where PyQt4 would always be selected in the case where a Qt related file was imported, but not set as the current backend Change from jrevans commit : Check what PyQt version is actually used rather than try to force the use of PyQt5.
@jrevans Does this fix your problems? |
# A different backend was specified, but we still got here because a Qt | ||
# related file was imported. This is allowed, so lets try and guess | ||
# what we should be using. | ||
if "PyQt5" in sys.modules: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you invert this logic to check for pyqt4 and default to 5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyQt5 is default, now.
Pyqt5 by default.
Fix comment
# A different backend was specified, but we still got here because a Qt | ||
# related file was imported. This is allowed, so lets try and guess | ||
# what we should be using. | ||
if "PyQt4" in sys.modules: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to check for PySide
, sorry I did not realize that before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the PyQt4 lines ?
I never used PySide. So, don't know its specificities.
Is the following change correct ?
if "PyQt4" in sys.modules:
=>
if "PyQt4" in sys.modules or "PySide" in sys.modules:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that looks like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PySide added.
Add PySide
Thanks! |
Related to this pull request :
#4912