diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-18 10:29:10 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-18 10:29:47 +0200 |
commit | eb30e3d7ee81c48cea720e7ecd2ed45647bc70ee (patch) | |
tree | 810e8ad0642434eeb4043c3a06c82217314300e1 /tests/auto/qml/qqmlproperty | |
parent | 9c9fca5e27bd91da1ea07bebd7569049493c5ccf (diff) | |
parent | 521ace713d8e5230d47f3da8cd941699ca085af2 (diff) |
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
src/qml/debugger/qv4debugservice.cpp
src/qml/jsruntime/qv4value_inl_p.h
src/qml/jsruntime/qv4value_p.h
src/qml/memory/qv4mm.cpp
src/qml/memory/qv4mm_p.h
src/qml/qml/qqmlnotifier_p.h
src/qml/qml/qqmlproperty.cpp
src/quick/items/qquickflickable.cpp
src/quick/items/qquicktextedit.cpp
tests/auto/quick/qquickwindow/BLACKLIST
The extra changes in qqmlbinding.cpp are ported from changes to
qqmlproperty.cpp that occurred in parallel with writeBinding() being
moved to qqmlbinding.cpp.
Change-Id: I16d1920abf448c29a01822256f52153651a56356
Diffstat (limited to 'tests/auto/qml/qqmlproperty')
-rw-r--r-- | tests/auto/qml/qqmlproperty/data/readonlyPrimitiveVsVar.qml | 8 | ||||
-rw-r--r-- | tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp | 15 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlproperty/data/readonlyPrimitiveVsVar.qml b/tests/auto/qml/qqmlproperty/data/readonlyPrimitiveVsVar.qml new file mode 100644 index 0000000000..253d61d1da --- /dev/null +++ b/tests/auto/qml/qqmlproperty/data/readonlyPrimitiveVsVar.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +QtObject { + readonly property var r_var: 1; + readonly property int r_int: 1; + property var w_var: 1; + property int w_int: 1; +} diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp index 1d6c2d87ff..d6b1c86b88 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(); |