diff options
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/qmlVarNullBinding.qml | 7 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/qmlVarNullBinding.qml b/tests/auto/qml/qqmlecmascript/data/qmlVarNullBinding.qml new file mode 100644 index 0000000000..6666b85ffd --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/qmlVarNullBinding.qml @@ -0,0 +1,7 @@ +import QtQml 2.2 + +QtObject { + property var foo: null + property bool signalSeen: false + onFooChanged: signalSeen = true +} diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 788ecce1c5..958bf847ce 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -5991,6 +5991,13 @@ void tst_qqmlecmascript::nullObjectInitializer() QVERIFY(value.userType() == qMetaTypeId<QObject*>()); QVERIFY(!value.value<QObject*>()); } + + { + QQmlComponent component(&engine, testFileUrl("qmlVarNullBinding.qml")); + QScopedPointer<QObject> obj(component.create()); + QVERIFY(!obj.isNull()); + QVERIFY(!obj->property("signalSeen").toBool()); + } } // Test that bindings don't evaluate once the engine has been destroyed |