Created
December 23, 2015 14:00
-
-
Save williballenthin/277eedca569043ef0984 to your computer and use it in GitHub Desktop.
Qt shim that handles simple PySide vs PyQt5 imports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_QtCore(): | |
try: | |
# IDA 6.8 and below | |
import PySide.QtCore as QtCore | |
return QtCore | |
except ImportError: | |
# IDA 6.9 | |
import PyQt5.QtCore as QtCore | |
return QtCore | |
def get_QtGui(): | |
try: | |
# IDA 6.8 and below | |
import PySide.QtGui as QtGui | |
return QtGui | |
except ImportError: | |
# IDA 6.9 | |
import PyQt5.QtGui as QtGui | |
return QtGui |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To update scripts depending on PySide, change lines like:
to:
Now the scripts can work with both PySide and PyQt5 (that is, on both IDAPython 6.8 and 6.9).