diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-10-19 15:51:36 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-10-21 09:48:00 +0200 |
commit | c837be7beab1c217b8f163b9a2d53ca12fd2c95e (patch) | |
tree | 2f59fbf8503872f5c6bc50af31a83061ca77c15e /src/qml/qml/qqmlcomponent.h | |
parent | 9021f46cc0ce1d89d5d62ccb622085437c8350a8 (diff) |
Provide a non-QQmlV4Function version of Component::createObject()
It actually just takes a parent object and a list of parameters, both
optional. We don't need varargs for that. It now warns if you pass more
parameters, but that is a good thing.
As the QQmlV4Function variant accepts a number of questionable values in
addition to QObject* and QVariantMap, we need to retain it.
Change-Id: Id39c07b890e4d2964ddb2cc498f56f2fe483e887
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlcomponent.h')
-rw-r--r-- | src/qml/qml/qqmlcomponent.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlcomponent.h b/src/qml/qml/qqmlcomponent.h index f0d51931a4..d60c2cdc9f 100644 --- a/src/qml/qml/qqmlcomponent.h +++ b/src/qml/qml/qqmlcomponent.h @@ -127,7 +127,14 @@ Q_SIGNALS: protected: QQmlComponent(QQmlComponentPrivate &dd, QObject* parent); + +#if QT_DEPRECATED_SINCE(6, 3) + QT_DEPRECATED_X("Use the overload with proper arguments") Q_INVOKABLE void createObject(QQmlV4Function *); +#endif + + Q_INVOKABLE QObject *createObject( + QObject *parent = nullptr, const QVariantMap &properties = {}); Q_INVOKABLE void incubateObject(QQmlV4Function *); private: |