Printing Qt for Python and Qt version¶
Qt for Python exports its version numbers in a pythonic way. You can print these numbers using the following python constructs:
import PySide2.QtCore # Prints PySide2 version # e.g. 5.11.1a1 print(PySide2.__version__) # Gets a tuple with each version component # e.g. (5, 11, 1, 'a', 1) print(PySide2.__version_info__) # Prints the Qt version used to compile PySide2 # e.g. "5.11.2" print(PySide2.QtCore.__version__) # Gets a tuple with each version components of Qt used to compile PySide2 # e.g. (5, 11, 2) print(PySide2.QtCore.__version_info__)
Note that the Qt version used to compile Qt for Python may differ from the version used to run Qt for Python. To print the current running Qt version number, you can use:
print(PySide2.QtCore.qVersion())
© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.