aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp58
-rw-r--r--tests/auto/qml/qmldesigner/coretests/tst_testcore.h1
-rw-r--r--tests/system/shared/project.py17
3 files changed, 71 insertions, 5 deletions
diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
index 4334e90aa64..1a4eda3bcc9 100644
--- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
+++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
@@ -4534,6 +4534,64 @@ void tst_TestCore::testImplicitComponents()
QCOMPARE(delegate.nodeSourceType(), ModelNode::NodeWithComponentSource);
}
+void tst_TestCore::testRevisionedProperties()
+{
+#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
+ const char* qmlString
+ = "import QtQuick 2.12\n"
+ "import QtQuick.Controls 2.0\n"
+ "import QtQuick.Layouts 1.0\n"
+ "\n"
+ "Item {\n"
+ "width: 640\n"
+ "height: 480\n"
+ "Rectangle {\n"
+ "gradient: Gradient {\n"
+ "orientation: Qt.Vertical\n"
+ "}\n"
+ "}\n"
+ "TextEdit {\n"
+ "leftPadding: 10\n"
+ "rightPadding: 10\n"
+ "topPadding: 10\n"
+ "bottomPadding: 10\n"
+ "}\n"
+ "}\n";
+
+ QPlainTextEdit textEdit;
+ textEdit.setPlainText(QLatin1String(qmlString));
+ NotIndentingTextEditModifier modifier(&textEdit);
+
+ QScopedPointer<Model> model(Model::create("QtQuick.Item"));
+ QVERIFY(model.data());
+ QScopedPointer<TestView> view(new TestView(model.data()));
+ QVERIFY(view.data());
+ model->attachView(view.data());
+
+ TestRewriterView *testRewriterView = new TestRewriterView(model.data());
+ testRewriterView->setCheckSemanticErrors(true);
+ testRewriterView->setTextModifier(&modifier);
+ model->attachView(testRewriterView);
+
+ QVERIFY(testRewriterView->errors().isEmpty());
+
+ ModelNode rootModelNode(view->rootModelNode());
+
+ QVERIFY(rootModelNode.isValid());
+
+ NodeMetaInfo metaInfo12 = model->metaInfo("QtQuick.Gradient", 2, 12);
+ NodeMetaInfo metaInfo11 = model->metaInfo("QtQuick.Gradient", -1, -1);
+ NodeMetaInfo metaInfoU = model->metaInfo("QtQuick.Gradient", -1, -1);
+
+ QVERIFY(metaInfo12.isValid());
+ QVERIFY(metaInfoU.isValid());
+
+ QVERIFY(metaInfo12.hasProperty("orientation"));
+ QVERIFY(metaInfoU.hasProperty("orientation"));
+
+#endif
+}
+
void tst_TestCore::testStatesRewriter()
{
QPlainTextEdit textEdit;
diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.h b/tests/auto/qml/qmldesigner/coretests/tst_testcore.h
index cde63a12d1c..3f1eec576b4 100644
--- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.h
+++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.h
@@ -62,6 +62,7 @@ private slots:
void testQtQuick20BasicRectangle();
void testQtQuickControls2();
void testImplicitComponents();
+ void testRevisionedProperties();
//
// unit tests Model, ModelNode, NodeProperty, AbstractView
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index 3afc7fc2a7f..00271bd77e3 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -303,15 +303,22 @@ def createNewQtQuickApplication(workingDir, projectName = None,
return checkedTargets, projectName
def createNewQtQuickUI(workingDir, qtVersion = "5.6"):
- __createProjectOrFileSelectType__(" Other Project", 'Qt Quick UI Prototype')
+ available = __createProjectOrFileSelectType__(" Other Project", 'Qt Quick UI Prototype')
if workingDir == None:
workingDir = tempDir()
projectName = __createProjectSetNameAndPath__(workingDir)
- __createProjectHandleQtQuickSelection__(qtVersion)
- __createProjectHandleLastPage__()
- progressBarWait(10000)
+ requiredQt = __createProjectHandleQtQuickSelection__(qtVersion)
+ __modifyAvailableTargets__(available, requiredQt)
+ snooze(1)
+ checkedTargets = __chooseTargets__(available, available)
+ if len(checkedTargets):
+ clickButton(waitForObject(":Next_QPushButton"))
+ __createProjectHandleLastPage__()
+ progressBarWait(10000)
+ else:
+ clickButton(waitForObject("{type='QPushButton' text='Cancel' visible='1'}"))
- return projectName
+ return checkedTargets, projectName
def createNewQmlExtension(workingDir, targets=[Targets.DESKTOP_5_6_1_DEFAULT]):
available = __createProjectOrFileSelectType__(" Library", "Qt Quick 2 Extension Plugin")