diff options
Diffstat (limited to 'sources/pyside2/PySide2/QtQml')
-rw-r--r-- | sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp | 8 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtQml/typesystem_qml.xml | 19 |
2 files changed, 18 insertions, 9 deletions
diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp index efc86a048..4218678bf 100644 --- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp +++ b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp @@ -132,7 +132,6 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor, Q_ASSERT(metaObject); QQmlPrivate::RegisterType type; - type.version = 0; // Allow registering Qt Quick items. bool registered = false; @@ -153,8 +152,8 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor, pyTypes[nextType] = pyObj; // FIXME: Fix this to assign new type ids each time. - type.typeId = qMetaTypeId<QObject *>(); - type.listId = qMetaTypeId<QQmlListProperty<QObject> >(); + type.typeId = QMetaType(QMetaType::QObjectStar); + type.listId = QMetaType::fromType<QQmlListProperty<QObject> >(); type.attachedPropertiesFunction = QQmlPrivate::attachedPropertiesFunc<QObject>(); type.attachedPropertiesMetaObject = QQmlPrivate::attachedPropertiesMetaObject<QObject>(); @@ -170,8 +169,7 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor, type.objectSize = objectSize; type.create = createFuncs[nextType]; type.uri = uri; - type.versionMajor = versionMajor; - type.versionMinor = versionMinor; + type.version = QTypeRevision::fromVersion(versionMajor, versionMinor); type.elementName = qmlName; type.extensionObjectCreate = 0; diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml index b61b28c07..4ebc4b417 100644 --- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml +++ b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml @@ -54,9 +54,18 @@ in generator tests folder. --> </primitive-type> + <enum-type name="QQmlModuleImportSpecialVersions" since="6.0"/> + <!-- For qmlEngine(const QObject*), qmlContext(const QObject*) in qqml.h --> <namespace-type name="QtQml"/> + <!-- FIXME Qt 6: expose QQmlIncubationController::incubateWhile() + (see QtQml_VolatileBoolTypeF in pysideqmlregistertype.h) + <namespace-type name="std" generate="no"> + <value-type name="atomic" generate="no"/> + </namespace-type> + --> + <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. @@ -93,6 +102,7 @@ <object-type name="QJSEngine"> <enum-type name="Extension" flags="Extensions" since="5.6"/> + <enum-type name="ObjectOwnership" since="6.0"/> <add-function signature="toScriptValue(const QVariant&)" return-type="QJSValue"> <inject-code class="target" position="end" file="../glue/qtqml.cpp" snippet="qjsengine-toscriptvalue"/> </add-function> @@ -116,7 +126,6 @@ <enum-type name="StartMode"/> </object-type> <object-type name="QQmlEngine"> - <enum-type name="ObjectOwnership"/> <modify-function signature="addImageProvider(const QString&,QQmlImageProviderBase*)"> <modify-argument index="2"> <define-ownership owner="c++"/> @@ -153,10 +162,11 @@ <enum-type name="Status"/> </object-type> <object-type name="QQmlIncubationController"> - <modify-function signature="incubateWhile(volatile bool*,int)" allow-thread="yes"> + <!-- FIXME Qt 6 + <modify-function signature="incubateWhile(std::atomic<bool>*,int)" allow-thread="yes"> <modify-argument index="1"> - <!-- The replace type is needed to use the VolatileBool_Check macro instead of - a template conversion function with "volatile bool" as argument. --> + The replace type is needed to use the VolatileBool_Check macro instead of + a template conversion function with "volatile bool" as argument. <replace-type modified-type="VolatileBool"/> <conversion-rule class="native"> volatile bool * %out = @@ -164,6 +174,7 @@ </conversion-rule> </modify-argument> </modify-function> + --> </object-type> <!-- TODO: QQmlListProperty is a template class, and thus should probably be treated like a |