diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-31 01:01:32 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-10-31 09:44:09 +0100 |
commit | 9c050d452961f348c8bcc33e3422aed6316bb18b (patch) | |
tree | b8af41758d885bfad84ccbd52e24eb1544908fda /tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp | |
parent | 59760e6ce0da6780fcbdf0b2dc123f989baaa3eb (diff) | |
parent | bcbc3c9cec1f7d7bb8c9d5f5ea94eb5c81ec2853 (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
.qmake.conf
src/qml/common/qv4compileddata_p.h
src/qml/types/qqmlbind.cpp
tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
Change-Id: I6a137907e63445f17a3d6181b832a6bd76135bb2
Diffstat (limited to 'tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp')
-rw-r--r-- | tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp index 7ebe0bac52..a15c00ad62 100644 --- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp +++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp @@ -41,6 +41,7 @@ #include <QtCore/private/qobject_p.h> #include "../../shared/util.h" #include "qobject.h" +#include <QtQml/QQmlPropertyMap> #include <QDebug> class MyQmlObject : public QObject @@ -155,6 +156,8 @@ private slots: void floatToStringPrecision(); void copy(); + + void nestedQQmlPropertyMap(); private: QQmlEngine engine; }; @@ -2209,6 +2212,24 @@ void tst_qqmlproperty::initTestCase() qmlRegisterType<MyContainer>("Test",1,0,"MyContainer"); } +void tst_qqmlproperty::nestedQQmlPropertyMap() +{ + QQmlPropertyMap mainPropertyMap; + QQmlPropertyMap nestedPropertyMap; + QQmlPropertyMap deeplyNestedPropertyMap; + + mainPropertyMap.insert("nesting1", QVariant::fromValue(&nestedPropertyMap)); + nestedPropertyMap.insert("value", 42); + nestedPropertyMap.insert("nesting2", QVariant::fromValue(&deeplyNestedPropertyMap)); + deeplyNestedPropertyMap.insert("value", "success"); + + QQmlProperty value{&mainPropertyMap, "nesting1.value"}; + QCOMPARE(value.read().toInt(), 42); + + QQmlProperty success{&mainPropertyMap, "nesting1.nesting2.value"}; + QCOMPARE(success.read().toString(), QLatin1String("success")); +} + QTEST_MAIN(tst_qqmlproperty) #include "tst_qqmlproperty.moc" |