Skip to content
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_VERSION_STR missing #40

Closed
mottosso opened this issue Jun 1, 2016 · 3 comments
Closed

QT_VERSION_STR missing #40

mottosso opened this issue Jun 1, 2016 · 3 comments
Labels

Comments

@mottosso
Copy link
Owner

mottosso commented Jun 1, 2016

Qt.__qt_version__ is currently showing the PyQt version, when it should be showing the Qt version.

@mottosso mottosso added the bug label Jun 1, 2016
@fredrikaverpil
Copy link
Collaborator

fredrikaverpil commented Jun 2, 2016

All of the below queried on my OS X dev machine.

PyQt4

>>> import PyQt4
>>> from PyQt4.QtCore import QT_VERSION_STR
>>> print QT_VERSION_STR
4.8.7
>>> from PyQt4.QtCore import PYQT_VERSION_STR
>>> print PYQT_VERSION_STR
4.11.4

PySide

import PySide

# Prints PySide version
# e.g. 1.2.2
print PySide.__version__

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

# Prints the Qt version used to compile PySide
# e.g. 4.8.7
print PySide.QtCore.__version__

# Gets a tuple with each version components of Qt used to compile PySide
# e.g. (4, 8, 7)
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:

# 4.8.7
print PySide.QtCore.qVersion()

PyQt5

>>> from PyQt5.QtCore import QT_VERSION_STR
>>> print QT_VERSION_STR
5.5.1
>>> from PyQt5.QtCore import PYQT_VERSION_STR
>>> print PYQT_VERSION_STR
5.5.1

This is a little suspicious, getting the same values. Could be a coincidence though:

PySide2

import PySide2

# Prints PySide version
# e.g. 2.0.0~alpha0
print PySide2.__version__

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

# Prints the Qt version used to compile PySide
# e.g. 5.6.1
print PySide2.QtCore.__version__

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

Note that the Qt version used to compile PySide2 may differ from the version used to run PySide2, to get the current running Qt version you can do:

# 5.6.1
print PySide2.QtCore.qVersion()

@mottosso
Copy link
Owner Author

mottosso commented Jun 2, 2016

That's a nice write up. Most of those things are in the current flavour, with only the Qt version missing from the PyQt bindings.

mottosso added a commit that referenced this issue Jun 3, 2016
@pipoun
Copy link

pipoun commented Jun 3, 2016

This is a little suspicious, getting the same values. Could be a coincidence though:

Both versions are unrelated: http://pyqt.sourceforge.net/Docs/PyQt5/introduction.html#an-explanation-of-version-numbers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants