summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PySide/QtCore/glue/qt_version.cpp5
-rw-r--r--PySide/QtCore/typesystem_core.xml10
2 files changed, 9 insertions, 6 deletions
diff --git a/PySide/QtCore/glue/qt_version.cpp b/PySide/QtCore/glue/qt_version.cpp
deleted file mode 100644
index 66f8c00..0000000
--- a/PySide/QtCore/glue/qt_version.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-QList<QByteArray> version = QByteArray(qVersion()).split('.');
-PyObject *pyQtVersion = Shiboken::makeTuple(version[0].toInt(), version[1].toInt(), version[2].toInt());
-
-PyModule_AddStringConstant(module, "__version__", qVersion());
-PyModule_AddObject(module, "__version_info__", pyQtVersion);
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index ea77ddc..9e698f1 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -891,7 +891,15 @@
qAddPostRoutine(PySide::globalPostRoutineCallback);
</inject-code>
- <inject-code class="target" position="end" file="glue/qt_version.cpp" />
+ <inject-code class="target" position="end">
+ QList&lt;QByteArray&gt; version = QByteArray(qVersion()).split('.');
+ PyObject* pyQtVersion = PyTuple_New(3);
+ for (int i = 0; i &lt; 3; ++i)
+ PyTuple_SET_ITEM(pyQtVersion, i, PyInt_FromLong(version[i].toInt()));
+ PyModule_AddObject(module, "__version_info__", pyQtVersion);
+ PyModule_AddStringConstant(module, "__version__", qVersion());
+ </inject-code>
+
<inject-code class="target" position="end">
{ // Avoid name clash
Shiboken::AutoDecRef atexit(Shiboken::Module::import("atexit"));