diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-08-25 16:18:55 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-08-31 12:42:27 +0200 |
commit | 22234c8a469be7c831aab51c9705e06f8624d24e (patch) | |
tree | b1dc266af3843eefdb6ed2a6719f601dd9dc51cf /tests | |
parent | f0cf6483ec73291fcef424951b69511388956acb (diff) |
Remove deprecated QQmlListProperty constructor
[ChangeLog][QML][QQmlListProperty] Removed deprecated QQmlListProperty
constructor taking a reference. Use the overload taking a pointer
instead.
Change-Id: I8942026d1bb1c88065659d96d648a4b256d7d427
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/types.h | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/testtypes.h | 4 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/testtypes.h | 10 | ||||
-rw-r--r-- | tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp | 7 | ||||
-rw-r--r-- | tests/benchmarks/qml/binding/testtypes.h | 2 | ||||
-rw-r--r-- | tests/benchmarks/qml/holistic/testtypes.h | 2 | ||||
-rw-r--r-- | tests/benchmarks/qml/qqmlcomponent/testtypes.h | 2 |
7 files changed, 12 insertions, 17 deletions
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/types.h b/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/types.h index dfba55a094..72f30d8f1f 100644 --- a/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/types.h +++ b/tests/auto/qml/qmlplugindump/data/dumper/ExtendedType/types.h @@ -55,7 +55,7 @@ class ExtendedType : public QObject public: ExtendedType(QObject *parent = nullptr) : QObject(parent) {} - QQmlListProperty<QObject> data() { return QQmlListProperty<QObject>(this, m_data); } + QQmlListProperty<QObject> data() { return QQmlListProperty<QObject>(this, &m_data); } private: QList<QObject *> m_data; diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h index 725624781b..922bef0ead 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.h +++ b/tests/auto/qml/qqmlecmascript/testtypes.h @@ -149,7 +149,7 @@ public: emit objectChanged(); } - QQmlListProperty<QObject> objectListProperty() { return QQmlListProperty<QObject>(this, m_objectQList); } + QQmlListProperty<QObject> objectListProperty() { return QQmlListProperty<QObject>(this, &m_objectQList); } bool methodCalled() const { return m_methodCalled; } bool methodIntCalled() const { return m_methodIntCalled; } @@ -320,7 +320,7 @@ class MyQmlContainer : public QObject public: MyQmlContainer() {} - QQmlListProperty<MyQmlObject> children() { return QQmlListProperty<MyQmlObject>(this, m_children); } + QQmlListProperty<MyQmlObject> children() { return QQmlListProperty<MyQmlObject>(this, &m_children); } private: QList<MyQmlObject*> m_children; diff --git a/tests/auto/qml/qqmllanguage/testtypes.h b/tests/auto/qml/qqmllanguage/testtypes.h index 9c2aaa9e30..469fe5467c 100644 --- a/tests/auto/qml/qqmllanguage/testtypes.h +++ b/tests/auto/qml/qqmllanguage/testtypes.h @@ -654,10 +654,10 @@ class MyContainer : public QObject public: MyContainer() {} - QQmlListProperty<QObject> children() { return QQmlListProperty<QObject>(this, m_children); } - QQmlListProperty<MyContainer> containerChildren() { return QQmlListProperty<MyContainer>(this, m_containerChildren); } + QQmlListProperty<QObject> children() { return QQmlListProperty<QObject>(this, &m_children); } + QQmlListProperty<MyContainer> containerChildren() { return QQmlListProperty<MyContainer>(this, &m_containerChildren); } QList<QObject *> *getChildren() { return &m_children; } - QQmlListProperty<MyInterface> qlistInterfaces() { return QQmlListProperty<MyInterface>(this, m_interfaces); } + QQmlListProperty<MyInterface> qlistInterfaces() { return QQmlListProperty<MyInterface>(this, &m_interfaces); } QList<MyInterface *> *getQListInterfaces() { return &m_interfaces; } QList<MyContainer*> m_containerChildren; @@ -820,7 +820,7 @@ namespace MyNamespace { Q_OBJECT Q_PROPERTY(QQmlListProperty<MyNamespace::MyNamespacedType> list READ list) public: - QQmlListProperty<MyNamespacedType> list() { return QQmlListProperty<MyNamespacedType>(this, m_list); } + QQmlListProperty<MyNamespacedType> list() { return QQmlListProperty<MyNamespacedType>(this, &m_list); } private: QList<MyNamespacedType *> m_list; @@ -1431,7 +1431,7 @@ class DeferredProperties : public QObject Q_CLASSINFO("DeferredPropertyNames", "groupProperty,listProperty") Q_CLASSINFO("DefaultProperty", "listProperty") public: - QQmlListProperty<QObject> listProperty() { return QQmlListProperty<QObject>(this, m_list); } + QQmlListProperty<QObject> listProperty() { return QQmlListProperty<QObject>(this, &m_list); } private: QObject *m_group = 0; diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp index e25d555d61..665fcdc9dc 100644 --- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp +++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp @@ -92,7 +92,6 @@ public: SyntheticClearAndReplace, SyntheticRemoveLast, SyntheticRemoveLastAndReplace, - AutomaticReference, AutomaticPointer }; @@ -115,7 +114,7 @@ public: return reinterpret_cast<QList<TestType *> *>(p->data)->removeLast(); } - TestType(Mode mode = AutomaticReference) + TestType(Mode mode = AutomaticPointer) { switch (mode) { case SyntheticClear: @@ -138,9 +137,6 @@ public: property = QQmlListProperty<TestType>(this, &data, append, count, at, clear, nullptr, nullptr); break; - case AutomaticReference: - property = QQmlListProperty<TestType>(this, data); - break; case AutomaticPointer: property = QQmlListProperty<TestType>(this, &data); break; @@ -159,7 +155,6 @@ Q_DECLARE_METATYPE(TestType::Mode) void tst_qqmllistreference::modeData() { QTest::addColumn<TestType::Mode>("mode"); - QTest::addRow("AutomaticReference") << TestType::AutomaticReference; QTest::addRow("AutomaticPointer") << TestType::AutomaticPointer; QTest::addRow("SyntheticClear") << TestType::SyntheticClear; QTest::addRow("SyntheticReplace") << TestType::SyntheticReplace; diff --git a/tests/benchmarks/qml/binding/testtypes.h b/tests/benchmarks/qml/binding/testtypes.h index 7e95c7ef67..4713a63483 100644 --- a/tests/benchmarks/qml/binding/testtypes.h +++ b/tests/benchmarks/qml/binding/testtypes.h @@ -48,7 +48,7 @@ public: int value() const { return m_value; } void setValue(int v) { m_value = v; emit valueChanged(); } - QQmlListProperty<QObject> data() { return QQmlListProperty<QObject>(this, m_data); } + QQmlListProperty<QObject> data() { return QQmlListProperty<QObject>(this, &m_data); } MyQmlObject *object() const { return m_object; } void setObject(MyQmlObject *o) { m_object = o; emit objectChanged(); } diff --git a/tests/benchmarks/qml/holistic/testtypes.h b/tests/benchmarks/qml/holistic/testtypes.h index 9d187f35ff..3cf0664ef2 100644 --- a/tests/benchmarks/qml/holistic/testtypes.h +++ b/tests/benchmarks/qml/holistic/testtypes.h @@ -109,7 +109,7 @@ public: emit objectChanged(); } - QQmlListProperty<QObject> objectListProperty() { return QQmlListProperty<QObject>(this, m_objectQList); } + QQmlListProperty<QObject> objectListProperty() { return QQmlListProperty<QObject>(this, &m_objectQList); } bool methodCalled() const { return m_methodCalled; } bool methodIntCalled() const { return m_methodIntCalled; } diff --git a/tests/benchmarks/qml/qqmlcomponent/testtypes.h b/tests/benchmarks/qml/qqmlcomponent/testtypes.h index 7e95c7ef67..4713a63483 100644 --- a/tests/benchmarks/qml/qqmlcomponent/testtypes.h +++ b/tests/benchmarks/qml/qqmlcomponent/testtypes.h @@ -48,7 +48,7 @@ public: int value() const { return m_value; } void setValue(int v) { m_value = v; emit valueChanged(); } - QQmlListProperty<QObject> data() { return QQmlListProperty<QObject>(this, m_data); } + QQmlListProperty<QObject> data() { return QQmlListProperty<QObject>(this, &m_data); } MyQmlObject *object() const { return m_object; } void setObject(MyQmlObject *o) { m_object = o; emit objectChanged(); } |