diff options
author | Luciano Wolf <luciano.wolf@openbossa.org> | 2010-08-02 17:12:18 -0300 |
---|---|---|
committer | Luciano Wolf <luciano.wolf@openbossa.org> | 2010-08-02 17:42:00 -0300 |
commit | 34a06b8de43767cc206d2a200c84e5505516e111 (patch) | |
tree | a3eacab74a0ce7454618746b78d03614d26342ca | |
parent | 630a4062ff9d837ae0f91056ab610183bf47370a (diff) |
Fix bug273 - QT_VERSION and QT_VERSION_STR constants.
Reviewer: Renato Araújo <renato.filho@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 6 | ||||
-rw-r--r-- | tests/QtCore/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtCore/qqtversion_test.py | 18 |
3 files changed, 25 insertions, 0 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index 84cf90632..9d38208ed 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -522,6 +522,12 @@ %PYARG_0 = %CONVERTTOPYTHON[long](qAbs(%1)); </inject-code> </add-function> + + <inject-code class="target" position="end"> + PyModule_AddIntConstant(module, "QT_VERSION", QT_VERSION); + PyModule_AddStringConstant(module, "QT_VERSION_STR", QT_VERSION_STR); + </inject-code> + <enum-type name="QtMsgType"/> <enum-type name="QSystemSemaphore::AccessMode"/> <enum-type name="QSystemSemaphore::SystemSemaphoreError"/> diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt index b8f739009..490f7349c 100644 --- a/tests/QtCore/CMakeLists.txt +++ b/tests/QtCore/CMakeLists.txt @@ -39,6 +39,7 @@ PYSIDE_TEST(qobject_timer_event_test.py) PYSIDE_TEST(qobject_tr_as_instance_test.py) PYSIDE_TEST(qpoint_test.py) PYSIDE_TEST(qprocess_test.py) +PYSIDE_TEST(qqtversion_test.py) PYSIDE_TEST(qrect_test.py) PYSIDE_TEST(qresource_test.py) PYSIDE_TEST(qsize_test.py) diff --git a/tests/QtCore/qqtversion_test.py b/tests/QtCore/qqtversion_test.py new file mode 100644 index 000000000..344de69ad --- /dev/null +++ b/tests/QtCore/qqtversion_test.py @@ -0,0 +1,18 @@ + +import unittest + +from PySide import QtCore + + +class QQtVersionTest(unittest.TestCase): + '''Tests for QtCore.QT_VERSION and QT_VERSION_STR''' + + def testVersion(self): + self.assert_(hex(QtCore.QT_VERSION) > 0x40500) + + def testVersionStr(self): + self.assert_(QtCore.QT_VERSION_STR) + + +if __name__ == '__main__': + unittest.main() |