forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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());
|
||||
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user