summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-15 07:59:55 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-15 07:59:55 (GMT)
commit4bcd23c4a9d5a596d0c90dbb1569385f30fadbac (patch)
tree528b256b294db80e54d44bd7c95b1881eeed5d1f /tests/auto
parent2980c4534b231c38584f88699d356ea26bb5266b (diff)
parent81044282befaa5af7247804c7875df83c89c6459 (diff)
downloadQt-4bcd23c4a9d5a596d0c90dbb1569385f30fadbac.zip
Qt-4bcd23c4a9d5a596d0c90dbb1569385f30fadbac.tar.gz
Qt-4bcd23c4a9d5a596d0c90dbb1569385f30fadbac.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: QmlDebug: Fix license headers in new ost plugin Fixed autotest after b4b85257ccff6ba21bcbcbd46a9f7f09884abe79 Resolve unqualified attached properties correctly Adding plugin qmltooling/qmlostplugin for QML debugging over OST (USB) on Symbian. QmlDebug: Rename 'tcpserver' library to 'qmldbg_tcp' QDeclarativeDebug: Don't crash when connection is closed Fix so concurrent jobs produce the correct model results Fix uninitialized variable.
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/attached.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp10
4 files changed, 36 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/attached.qml b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
index 5da4a69..c5d5535 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
@@ -17,7 +17,7 @@ Rectangle {
transitions: Transition {
PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
- ScriptAction { script: console.log(ListView.delayRemove ? "on" : "off") }
+ ScriptAction { script: console.log(wrapper.ListView.delayRemove ? "on" : "off") }
}
Component.onCompleted: {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml
new file mode 100644
index 0000000..a7184c9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml
@@ -0,0 +1,22 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ property alias a: me.a
+ property alias b: me.a
+ property alias c: me.a
+ property alias d: me.a
+
+ property MyQmlObject obj
+ obj: MyQmlObject {
+ MyQmlObject.value2: 13
+
+ id: me
+ property int a: MyQmlObject.value2 * 2
+ property int b: Namespace.MyQmlObject.value2 * 2
+ property int c: me.Namespace.MyQmlObject.value * 2
+ property int d: me.Namespace.MyQmlObject.value * 2
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
index 94cec3f..ad38d27 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
@@ -60,17 +60,18 @@ class MyQmlAttachedObject : public QObject
{
Q_OBJECT
Q_PROPERTY(int value READ value CONSTANT)
- Q_PROPERTY(int value2 READ value2 WRITE setValue2)
+ Q_PROPERTY(int value2 READ value2 WRITE setValue2 NOTIFY value2Changed)
public:
MyQmlAttachedObject(QObject *parent) : QObject(parent), m_value2(0) {}
int value() const { return 19; }
int value2() const { return m_value2; }
- void setValue2(int v) { m_value2 = v; }
+ void setValue2(int v) { if (m_value2 == v) return; m_value2 = v; emit value2Changed(); }
void emitMySignal() { emit mySignal(); }
signals:
+ void value2Changed();
void mySignal();
private:
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 7876671..1ec12fe 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -650,6 +650,16 @@ void tst_qdeclarativeecmascript::attachedProperties()
}
{
+ QDeclarativeComponent component(&engine, TEST_FILE("attachedProperty.2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("a").toInt(), 26);
+ QCOMPARE(object->property("b").toInt(), 26);
+ QCOMPARE(object->property("c").toInt(), 26);
+ QCOMPARE(object->property("d").toInt(), 26);
+ }
+
+ {
QDeclarativeComponent component(&engine, TEST_FILE("writeAttachedProperty.qml"));
QObject *object = component.create();
QVERIFY(object != 0);