aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-08-31 13:27:06 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2021-08-31 13:51:06 +0200
commit37b2231f1a7bb18c0bf699c4a1cb103fe9dfacae (patch)
tree1c0d7c8b7451535f50411a10d0fd7de87695520d /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
parentdad21c9202e350011673f846242f5341f650162e (diff)
tst_qqmlecmascript: Test that deferred names gets overwritten
Change-Id: I32d7ba2230dbd98f918e6e55abbe6b3fd43028d2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 9b7286dc0e..5244530b66 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -101,6 +101,7 @@ private slots:
void dependenciesWithFunctions();
void deferredProperties();
void deferredPropertiesParent();
+ void deferredPropertiesOverwrite();
void deferredPropertiesByParent();
void deferredPropertiesErrors();
void deferredPropertiesInComponents();
@@ -1231,6 +1232,17 @@ void tst_qqmlecmascript::deferredPropertiesParent()
QCOMPARE(object->baseValue(), 10);
}
+void tst_qqmlecmascript::deferredPropertiesOverwrite()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("deferredPropertiesOverwrite.qml"));
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY2(obj, qPrintable(component.errorString()));
+ DeferredChildOverwrite *object = qobject_cast<DeferredChildOverwrite *>(obj.data());
+ QVERIFY(object != nullptr);
+ QCOMPARE(object->baseValue(), 10);
+}
+
void tst_qqmlecmascript::deferredPropertiesByParent()
{
QQmlEngine engine;