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()
|
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;
|
QPlainTextEdit textEdit;
|
||||||
textEdit.setPlainText(QString::fromUtf8(qmlString));
|
textEdit.setPlainText(QString::fromUtf8(qmlString));
|
||||||
@@ -7355,7 +7355,7 @@ void tst_TestCore::testRewriterRemoveId()
|
|||||||
|
|
||||||
ModelNode rootModelNode(view->rootModelNode());
|
ModelNode rootModelNode(view->rootModelNode());
|
||||||
QVERIFY(rootModelNode.isValid());
|
QVERIFY(rootModelNode.isValid());
|
||||||
QCOMPARE(rootModelNode.id(), QString("rect"));
|
QCOMPARE(rootModelNode.id(), QString("myRect"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// remove id in text
|
// remove id in text
|
||||||
@@ -8518,7 +8518,7 @@ void tst_TestCore::loadTestFiles()
|
|||||||
QCOMPARE(rootModelNode.directSubModelNodes().count(), 4);
|
QCOMPARE(rootModelNode.directSubModelNodes().count(), 4);
|
||||||
QCOMPARE(rootModelNode.variantProperty("width").value().toInt(), 200);
|
QCOMPARE(rootModelNode.variantProperty("width").value().toInt(), 200);
|
||||||
QCOMPARE(rootModelNode.variantProperty("height").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.hasProperty("data"));
|
||||||
QVERIFY(rootModelNode.property("data").isDefaultProperty());
|
QVERIFY(rootModelNode.property("data").isDefaultProperty());
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: rect
|
id: myRect
|
||||||
width: 200
|
width: 200
|
||||||
height: 200
|
height: 200
|
||||||
Text {
|
Text {
|
||||||
@@ -39,7 +39,7 @@ Rectangle {
|
|||||||
State {
|
State {
|
||||||
name: "State1"
|
name: "State1"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: rect
|
target: myRect
|
||||||
color: "blue"
|
color: "blue"
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
@@ -50,7 +50,7 @@ Rectangle {
|
|||||||
State {
|
State {
|
||||||
name: "State2"
|
name: "State2"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: rect
|
target: myRect
|
||||||
color: "gray"
|
color: "gray"
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
|
Reference in New Issue
Block a user