diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-07-12 20:33:07 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-07-13 06:50:07 +0000 |
commit | 7354d8a4622275dfc8403dde0ca77b0ce1777d63 (patch) | |
tree | d385ad7a631ef9cd4d03a470ed858eb7a8b1dca9 /tests | |
parent | 57413c67039253f93c78e182a46bc04065f9d0d2 (diff) | |
download | qt-creator-7354d8a4622275dfc8403dde0ca77b0ce1777d63.tar.gz |
QmlDesigner: Fix tests
We do not allow rect as id, since it is also a QML type.
Change-Id: I348071b9b1f6c3e72d3934770196421ce72d36b5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp | 6 | ||||
-rw-r--r-- | tests/auto/qml/qmldesigner/data/fx/states.qml | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index 1c0239b542..ef77342719 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -7336,7 +7336,7 @@ void tst_TestCore::testRewriterChangeId() void tst_TestCore::testRewriterRemoveId() { - const char* qmlString = "import QtQuick 2.1\nRectangle { id: rect }"; + const char* qmlString = "import QtQuick 2.1\nRectangle { id: myRect }"; QPlainTextEdit textEdit; textEdit.setPlainText(QString::fromUtf8(qmlString)); @@ -7355,7 +7355,7 @@ void tst_TestCore::testRewriterRemoveId() ModelNode rootModelNode(view->rootModelNode()); QVERIFY(rootModelNode.isValid()); - QCOMPARE(rootModelNode.id(), QString("rect")); + QCOMPARE(rootModelNode.id(), QString("myRect")); // // remove id in text @@ -8518,7 +8518,7 @@ void tst_TestCore::loadTestFiles() QCOMPARE(rootModelNode.directSubModelNodes().count(), 4); QCOMPARE(rootModelNode.variantProperty("width").value().toInt(), 200); QCOMPARE(rootModelNode.variantProperty("height").value().toInt(), 200); - QCOMPARE(rootModelNode.id(), QLatin1String("rect")); + QCOMPARE(rootModelNode.id(), QLatin1String("myRect")); QVERIFY(rootModelNode.hasProperty("data")); QVERIFY(rootModelNode.property("data").isDefaultProperty()); diff --git a/tests/auto/qml/qmldesigner/data/fx/states.qml b/tests/auto/qml/qmldesigner/data/fx/states.qml index b0dd3f3d38..a37db5b2d4 100644 --- a/tests/auto/qml/qmldesigner/data/fx/states.qml +++ b/tests/auto/qml/qmldesigner/data/fx/states.qml @@ -26,7 +26,7 @@ import QtQuick 2.0 Rectangle { - id: rect + id: myRect width: 200 height: 200 Text { @@ -39,7 +39,7 @@ Rectangle { State { name: "State1" PropertyChanges { - target: rect + target: myRect color: "blue" } PropertyChanges { @@ -50,7 +50,7 @@ Rectangle { State { name: "State2" PropertyChanges { - target: rect + target: myRect color: "gray" } PropertyChanges { |