diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qscriptqobject/tst_qscriptqobject.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp index d8db7b7..14d3283 100644 --- a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp +++ b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp @@ -736,6 +736,8 @@ void tst_QScriptExtQObject::getSetStaticProperty() // test that we do value conversion if necessary when setting properties { QScriptValue br = m_engine->evaluate("myObject.brushProperty"); + QVERIFY(br.isVariant()); + QVERIFY(!br.strictlyEquals(m_engine->evaluate("myObject.brushProperty"))); QCOMPARE(qscriptvalue_cast<QBrush>(br), m_myObject->brushProperty()); QCOMPARE(qscriptvalue_cast<QColor>(br), m_myObject->brushProperty().color()); @@ -838,6 +840,14 @@ void tst_QScriptExtQObject::getSetStaticProperty() mobj.setProperty("intProperty", m_engine->newFunction(getSetProperty), QScriptValue::PropertyGetter | QScriptValue::PropertySetter); } + + // method properties are persistent + { + QScriptValue slot = m_engine->evaluate("myObject.mySlot"); + QVERIFY(slot.isFunction()); + QScriptValue sameSlot = m_engine->evaluate("myObject.mySlot"); + QVERIFY(sameSlot.strictlyEquals(slot)); + } } void tst_QScriptExtQObject::getSetDynamicProperty() |