summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativelanguage
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-08-31 07:37:30 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-08-31 07:37:30 (GMT)
commiteb0307cac2f6c35094ffcf7de782881cb440cf2f (patch)
tree95dc6c5441111dda2987cd296fe2a65ed19ee4fd /tests/auto/declarative/qdeclarativelanguage
parent6a40104d587211dc740232fed908e29f0b58e2d9 (diff)
downloadQt-eb0307cac2f6c35094ffcf7de782881cb440cf2f.zip
Qt-eb0307cac2f6c35094ffcf7de782881cb440cf2f.tar.gz
Qt-eb0307cac2f6c35094ffcf7de782881cb440cf2f.tar.bz2
Ignore non-scriptable properties in QML
QTBUG-13043
Diffstat (limited to 'tests/auto/declarative/qdeclarativelanguage')
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/testtypes.h4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp2
6 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.errors.txt
new file mode 100644
index 0000000..93652a7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.errors.txt
@@ -0,0 +1 @@
+5:23:Invalid alias location
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.qml
new file mode 100644
index 0000000..2a09648
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias a: root.nonScriptable
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.errors.txt
new file mode 100644
index 0000000..cdfa4b2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.errors.txt
@@ -0,0 +1 @@
+4:5:Cannot assign to non-existent property "nonScriptable"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.qml
new file mode 100644
index 0000000..bd59bc8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyQmlObject {
+ nonScriptable: 11
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
index 19790f1..ac55bae 100644
--- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h
+++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
@@ -112,6 +112,7 @@ class MyQmlObject : public QObject, public MyInterface
Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType)
Q_PROPERTY(MyQmlObject *qmlobjectProperty READ qmlobject WRITE setQmlobject)
Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal)
+ Q_PROPERTY(int nonScriptable READ nonScriptable WRITE setNonScriptable SCRIPTABLE false);
Q_INTERFACES(MyInterface)
public:
@@ -150,6 +151,9 @@ public:
int propertyWithNotify() const { return m_propertyWithNotify; }
void setPropertyWithNotify(int i) { m_propertyWithNotify = i; emit oddlyNamedNotifySignal(); }
+
+ int nonScriptable() const { return 0; }
+ void setNonScriptable(int) {}
public slots:
void basicSlot() { qWarning("MyQmlObject::basicSlot"); }
void basicSlotWithArgs(int v) { qWarning("MyQmlObject::basicSlotWithArgs(%d)", v); }
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index b43fbf4..fc78663 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -343,6 +343,7 @@ void tst_qdeclarativelanguage::errors_data()
QTest::newRow("invalidAlias.4") << "invalidAlias.4.qml" << "invalidAlias.4.errors.txt" << false;
QTest::newRow("invalidAlias.5") << "invalidAlias.5.qml" << "invalidAlias.5.errors.txt" << false;
QTest::newRow("invalidAlias.6") << "invalidAlias.6.qml" << "invalidAlias.6.errors.txt" << false;
+ QTest::newRow("invalidAlias.7") << "invalidAlias.7.qml" << "invalidAlias.7.errors.txt" << false;
QTest::newRow("invalidAttachedProperty.1") << "invalidAttachedProperty.1.qml" << "invalidAttachedProperty.1.errors.txt" << false;
QTest::newRow("invalidAttachedProperty.2") << "invalidAttachedProperty.2.qml" << "invalidAttachedProperty.2.errors.txt" << false;
@@ -373,6 +374,7 @@ void tst_qdeclarativelanguage::errors_data()
QTest::newRow("assignToNamespace") << "assignToNamespace.qml" << "assignToNamespace.errors.txt" << false;
QTest::newRow("invalidOn") << "invalidOn.qml" << "invalidOn.errors.txt" << false;
QTest::newRow("invalidProperty") << "invalidProperty.qml" << "invalidProperty.errors.txt" << false;
+ QTest::newRow("nonScriptableProperty") << "nonScriptableProperty.qml" << "nonScriptableProperty.errors.txt" << false;
}