summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-10 18:48:16 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-10 18:55:12 (GMT)
commit6bffb9055a6548730ba915630007ba44b292b03f (patch)
treec07d32efbba69e35318e4c9ea078afd5fe1f9987 /tests/auto/qscriptqobject/tst_qscriptqobject.cpp
parent435fae071798817f57bc89bf5d1ac20aae488625 (diff)
parent4d31527417419d4f7c1417b9360ef91d72469aa0 (diff)
downloadQt-6bffb9055a6548730ba915630007ba44b292b03f.zip
Qt-6bffb9055a6548730ba915630007ba44b292b03f.tar.gz
Qt-6bffb9055a6548730ba915630007ba44b292b03f.tar.bz2
Merge commit 'qt/master' into graphicssceneindex
Conflicts: src/gui/graphicsview/qgraphicsitem_p.h tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp tests/auto/qgraphicsview/tst_qgraphicsview.cpp
Diffstat (limited to 'tests/auto/qscriptqobject/tst_qscriptqobject.cpp')
-rw-r--r--tests/auto/qscriptqobject/tst_qscriptqobject.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
index 14d3283..ee914ab 100644
--- a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
+++ b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
@@ -605,6 +605,12 @@ void tst_QScriptExtQObject::getSetStaticProperty()
QVERIFY(!(mobj.propertyFlags("mySlot") & QScriptValue::Undeletable));
QVERIFY(!(mobj.propertyFlags("mySlot") & QScriptValue::SkipInEnumeration));
QVERIFY(mobj.propertyFlags("mySlot") & QScriptValue::QObjectMember);
+
+ // signature-based property
+ QVERIFY(!(mobj.propertyFlags("mySlot()") & QScriptValue::ReadOnly));
+ QVERIFY(!(mobj.propertyFlags("mySlot()") & QScriptValue::Undeletable));
+ QVERIFY(!(mobj.propertyFlags("mySlot()") & QScriptValue::SkipInEnumeration));
+ QVERIFY(mobj.propertyFlags("mySlot()") & QScriptValue::QObjectMember);
}
// property change in C++ should be reflected in script
@@ -847,6 +853,9 @@ void tst_QScriptExtQObject::getSetStaticProperty()
QVERIFY(slot.isFunction());
QScriptValue sameSlot = m_engine->evaluate("myObject.mySlot");
QVERIFY(sameSlot.strictlyEquals(slot));
+ sameSlot = m_engine->evaluate("myObject['mySlot()']");
+ QEXPECT_FAIL("", "Signature-based method lookup creates new function wrapper object", Continue);
+ QVERIFY(sameSlot.strictlyEquals(slot));
}
}
@@ -897,6 +906,20 @@ void tst_QScriptExtQObject::getSetChildren()
QCOMPARE(m_engine->evaluate("myObject.hasOwnProperty('child')")
.strictlyEquals(QScriptValue(m_engine, true)), true);
+ QScriptValue mobj = m_engine->evaluate("myObject");
+ QVERIFY(mobj.propertyFlags("child") & QScriptValue::ReadOnly);
+ QVERIFY(mobj.propertyFlags("child") & QScriptValue::Undeletable);
+ QVERIFY(mobj.propertyFlags("child") & QScriptValue::SkipInEnumeration);
+ QVERIFY(!(mobj.propertyFlags("child") & QScriptValue::QObjectMember));
+
+ {
+ QScriptValue scriptChild = m_engine->evaluate("myObject.child");
+ QVERIFY(scriptChild.isQObject());
+ QCOMPARE(scriptChild.toQObject(), (QObject*)child);
+ QScriptValue sameChild = m_engine->evaluate("myObject.child");
+ QVERIFY(sameChild.strictlyEquals(scriptChild));
+ }
+
// add a grandchild
MyQObject *grandChild = new MyQObject(child);
grandChild->setObjectName("grandChild");