aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
diff options
context:
space:
mode:
authorMichael Brasser <mbrasser@ford.com>2014-12-11 21:18:00 -0600
committerMichael Brasser <michael.brasser@live.com>2014-12-23 00:58:51 +0100
commit5adb406bddd8419c2987cec48eb86a0d4ca0260a (patch)
tree266e29eba0739751809fd2fdfc85933c38c919de /tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
parentfa3cf15e0577fe382ac577456422ad78325a3977 (diff)
Fix QQmlProperty to work correctly with deeply nested objects.
Don't keep reusing the top-level object to look up nested properties. This allows code such as the following to work correctly: PropertyChanges { target: myObject textChild.font.pixelSize: 24 } Change-Id: I39e52dbc20d2409fc756a36e668fcf664eb1905f Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp')
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index 62ccec5794..ed09e6d14f 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -47,8 +47,12 @@
class MyQmlObject : public QObject
{
Q_OBJECT
+ Q_PROPERTY(QPoint pointProperty MEMBER m_point)
public:
MyQmlObject(QObject *parent = 0) : QObject(parent) {}
+
+private:
+ QPoint m_point;
};
QML_DECLARE_TYPE(MyQmlObject);
@@ -141,6 +145,7 @@ private slots:
void assignEmptyVariantMap();
void warnOnInvalidBinding();
void registeredCompositeTypeProperty();
+ void deeplyNestedObject();
void copy();
private:
@@ -1938,6 +1943,16 @@ void tst_qqmlproperty::warnOnInvalidBinding()
delete obj;
}
+void tst_qqmlproperty::deeplyNestedObject()
+{
+ PropertyObject o;
+ QQmlProperty p(&o, "qmlObject.pointProperty.x");
+ QCOMPARE(p.isValid(), true);
+
+ p.write(14);
+ QCOMPARE(p.read(), QVariant(14));
+}
+
void tst_qqmlproperty::initTestCase()
{
QQmlDataTest::initTestCase();