aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside2/PySide2/QtQml/CMakeLists.txt1
-rw-r--r--sources/pyside2/PySide2/QtQml/typesystem_qml.xml3
-rwxr-xr-xsources/pyside2/tests/QtQml/qquickview_test.py6
3 files changed, 9 insertions, 1 deletions
diff --git a/sources/pyside2/PySide2/QtQml/CMakeLists.txt b/sources/pyside2/PySide2/QtQml/CMakeLists.txt
index c584c3371..cfd1b6857 100644
--- a/sources/pyside2/PySide2/QtQml/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtQml/CMakeLists.txt
@@ -30,6 +30,7 @@ ${QtQml_GEN_DIR}/qqmlpropertymap_wrapper.cpp
${QtQml_GEN_DIR}/qqmlpropertyvaluesource_wrapper.cpp
${QtQml_GEN_DIR}/qqmlscriptstring_wrapper.cpp
${QtQml_GEN_DIR}/qqmlnetworkaccessmanagerfactory_wrapper.cpp
+${QtQml_GEN_DIR}/qtqml_wrapper.cpp
# module is always needed
${QtQml_GEN_DIR}/qtqml_module_wrapper.cpp
)
diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
index b0bdfaa27..250d1ea81 100644
--- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
+++ b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
@@ -54,6 +54,9 @@
in generator tests folder. -->
</primitive-type>
+ <!-- For qmlEngine(const QObject*), qmlContext(const QObject*) in qqml.h -->
+ <namespace-type name="QtQml"/>
+
<add-function signature="qmlRegisterType(PyTypeObject,const char*,int,int,const char*)" return-type="int">
<inject-documentation format="target" mode="append">
This function registers the Python type in the QML system with the name qmlName, in the library imported from uri having the version number composed from versionMajor and versionMinor.
diff --git a/sources/pyside2/tests/QtQml/qquickview_test.py b/sources/pyside2/tests/QtQml/qquickview_test.py
index 1b503fa7e..62b20738f 100755
--- a/sources/pyside2/tests/QtQml/qquickview_test.py
+++ b/sources/pyside2/tests/QtQml/qquickview_test.py
@@ -33,6 +33,7 @@ import unittest
from helper import adjust_filename, TimedQApplication
from PySide2.QtCore import QUrl, QObject, Property, Slot
+from PySide2.QtQml import QtQml
from PySide2.QtQuick import QQuickView
class MyObject(QObject):
@@ -66,7 +67,10 @@ class TestQQuickView(TimedQApplication):
view.show()
self.assertEqual(view.status(), QQuickView.Ready)
-
+ rootObject = view.rootObject()
+ self.assertTrue(rootObject)
+ self.assertTrue(QtQml.qmlEngine(rootObject))
+ self.assertTrue(QtQml.qmlContext(rootObject))
def testModelExport(self):
view = QQuickView()