summaryrefslogtreecommitdiff
path: root/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
diff options
context:
space:
mode:
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 1d6c2d87f..d6b1c86b8 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -146,6 +146,7 @@ private slots:
void warnOnInvalidBinding();
void registeredCompositeTypeProperty();
void deeplyNestedObject();
+ void readOnlyDynamicProperties();
void copy();
private:
@@ -2039,6 +2040,20 @@ void tst_qqmlproperty::deeplyNestedObject()
QCOMPARE(p.read(), QVariant(14));
}
+void tst_qqmlproperty::readOnlyDynamicProperties()
+{
+ QQmlComponent comp(&engine, testFileUrl("readonlyPrimitiveVsVar.qml"));
+ QObject *obj = comp.create();
+ QVERIFY(obj != 0);
+
+ QVERIFY(!obj->metaObject()->property(obj->metaObject()->indexOfProperty("r_var")).isWritable());
+ QVERIFY(!obj->metaObject()->property(obj->metaObject()->indexOfProperty("r_int")).isWritable());
+ QVERIFY(obj->metaObject()->property(obj->metaObject()->indexOfProperty("w_var")).isWritable());
+ QVERIFY(obj->metaObject()->property(obj->metaObject()->indexOfProperty("w_int")).isWritable());
+
+ delete obj;
+}
+
void tst_qqmlproperty::initTestCase()
{
QQmlDataTest::initTestCase();