diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-05-08 12:41:25 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-05-08 12:41:25 +0200 |
commit | 4545c81e570c477ae8821531dcfd593e09f950b0 (patch) | |
tree | f756738ffaf55210a2aa1596407eeed94e504ae7 /tests/auto | |
parent | d0839bc1de52acd0902364565b6f9d030e591646 (diff) | |
parent | 75e408584ac9a60c3a4dd714f5620814485fcdca (diff) |
Merge remote-tracking branch 'origin/4.9'
Conflicts:
doc/src/howto/creator-sidebar-views.qdoc
doc/src/howto/creator-ui.qdoc
qbs/modules/qtc/qtc.qbs
qtcreator.pri
src/plugins/autotest/testresultmodel.cpp
src/plugins/autotest/testresultmodel.h
Change-Id: I24cc585ca7782cb1d9cb0b8b73b46892b41937fd
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp | 58 | ||||
-rw-r--r-- | tests/auto/qml/qmldesigner/coretests/tst_testcore.h | 1 |
2 files changed, 59 insertions, 0 deletions
diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index 4334e90aa6..1a4eda3bcc 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 cde63a12d1..3f1eec576b 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 |