aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/doc/pysideversion.rst
blob: 24afba12dae23b1f827cb6e9b1700f3a64c73a03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Printing |project| and Qt version
*********************************

|project| exports its version numbers in a pythonic way. You can print these
numbers using the following python constructs:

  ::

    import PySide2.QtCore

    # Prints PySide version
    # e.g. 1.0.2
    print(PySide2.__version__)

    # Gets a tuple with each version component
    # e.g. (1, 0, 2, 'final', 1)
    print(PySide2.__version_info__)

    # Prints the Qt version used to compile PySide
    # e.g. "5.11.0"
    print(PySide2.QtCore.__version__)

    # Gets a tuple with each version components of Qt used to compile PySide
    # e.g. (5, 11, 0)
    print(PySide2.QtCore.__version_info__)


Note that the Qt version used to compile |project| may differ from the version used to
run |project|. To print the current running Qt version number, you can use::

    print(PySide2.QtCore.qVersion())