Fix documentation bug 853 - "Provide constants for Qt and PySide version"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Renato Araújo <renato.filho@openbossa.org>
This commit is contained in:
parent
4fd1c23ae3
commit
17a4a02354
2 changed files with 32 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ Other stuff
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
pysideapi2.rst
|
pysideapi2.rst
|
||||||
|
pysideversion.rst
|
||||||
|
|
||||||
Module Index
|
Module Index
|
||||||
============
|
============
|
||||||
|
|
|
||||||
31
doc/pysideversion.rst
Normal file
31
doc/pysideversion.rst
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
Getting PySide and Qt version
|
||||||
|
*****************************
|
||||||
|
|
||||||
|
PySide exports their version numbers among the version of Qt used to compile PySide in a pythonnic way, you can check it using the variables:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
import PySide
|
||||||
|
|
||||||
|
# Prints PySide version
|
||||||
|
# e.g. 1.0.2
|
||||||
|
print PySide.__version__
|
||||||
|
|
||||||
|
# Gets a tuple with each version component
|
||||||
|
# e.g. (1, 0, 2, 'final', 1)
|
||||||
|
print PySide.__version_info__
|
||||||
|
|
||||||
|
# Prints the Qt version used to compile PySide
|
||||||
|
# e.g. "4.7.2"
|
||||||
|
print PySide.QtCore.__version__
|
||||||
|
|
||||||
|
# Gets a tuple with each version components of Qt used to compile PySide
|
||||||
|
# e.g. (4, 7, 2)
|
||||||
|
print PySide.QtCore.__version_info__
|
||||||
|
|
||||||
|
|
||||||
|
Note that the Qt version used to compile PySide may differ from the version used to run PySide, to get the current running Qt version you can do:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
print PySide.QtCore.qVersion()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue