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 <christian.stenger@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2021-06-16 22:19:53 +02:00
parent 0fb40e204b
commit e1c90bf047

View File

@@ -4170,14 +4170,24 @@ void tst_TestCore::loadQml()
ModelNode rootModelNode(view->rootModelNode());
QVERIFY(rootModelNode.isValid());
QCOMPARE(rootModelNode.type(), QmlDesigner::TypeName("QtQuick.Item"));
QScopedPointer<TestRewriterView> 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);