From e1c90bf047efd99e47820eac8c145535c20681fc Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 16 Jun 2021 22:19:53 +0200 Subject: [PATCH] QmlDesigner: Extend tst_TestCore::loadQml() We should check for the version. For this we have to enable semantic errors. Change-Id: I8bedca041ebf9bbc0580b89076203e47942cc539 Reviewed-by: Christian Stenger Reviewed-by: Thomas Hartmann --- tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index fe658e81252..3d23777eaa9 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -4170,14 +4170,24 @@ void tst_TestCore::loadQml() ModelNode rootModelNode(view->rootModelNode()); QVERIFY(rootModelNode.isValid()); + QCOMPARE(rootModelNode.type(), QmlDesigner::TypeName("QtQuick.Item")); QScopedPointer testRewriterView(new TestRewriterView()); + testRewriterView->setCheckSemanticErrors(true); testRewriterView->setTextModifier(&textModifier); model->attachView(testRewriterView.data()); + while (testRewriterView->hasIncompleteTypeInformation()) { + QApplication::processEvents(QEventLoop::AllEvents, 1000); + } + + QVERIFY(testRewriterView->errors().isEmpty()); + QVERIFY(rootModelNode.isValid()); QCOMPARE(rootModelNode.type(), QmlDesigner::TypeName("QtQuick.Rectangle")); + QCOMPARE(rootModelNode.majorVersion(), 2); + QCOMPARE(rootModelNode.id(), QString("root")); QCOMPARE(rootModelNode.variantProperty("width").value().toInt(), 200); QCOMPARE(rootModelNode.variantProperty("height").value().toInt(), 200);