aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compat
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2024-11-01 17:11:38 +0100
committerUlf Hermann <[email protected]>2024-11-06 10:00:07 +0100
commit05b783617ff897c5c7b94bd9df19d0ff26c20396 (patch)
tree83ecf68a6abb6a3fe8fdf13e32b169985d8f4544 /src/qml/compat
parent9a64a5cc9083afcaf43cb65e132ec5d1e66e65c3 (diff)
QmlCompiler: Support construction of value types with 'new'
This allows us to create value types with invokable copy ctors from JavaScript objects that describe their properties. That way we now have a full replacement for the Qt.foo() methods. As a side effect, we support retrieval of enums for certain kinds of broken value types now, if prefixed with a namespace. Fixes: QTBUG-124634 Change-Id: If2a3c59d647e211ef5a0cd1ddee04b409d9ea5f3 Reviewed-by: Olivier De Cannière <[email protected]>
Diffstat (limited to 'src/qml/compat')
-rw-r--r--src/qml/compat/removed_api.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/compat/removed_api.cpp b/src/qml/compat/removed_api.cpp
index 3ee11717cd..4cbaab71a9 100644
--- a/src/qml/compat/removed_api.cpp
+++ b/src/qml/compat/removed_api.cpp
@@ -116,4 +116,13 @@ void QQmlPrivate::AOTCompiledContext::initLoadGlobalLookup(uint index) const
engine->handle()->amendException();
}
+QVariant QQmlPrivate::AOTCompiledContext::constructValueType(
+ QMetaType resultMetaType, const QMetaObject *resultMetaObject,
+ int ctorIndex, void *ctorArg) const
+{
+ void *args[] = {ctorArg};
+ return QQmlValueTypeProvider::constructValueType(
+ resultMetaType, resultMetaObject, ctorIndex, args);
+}
+
#endif