forked from qt-creator/qt-creator
QmlDesigner: Use QtQuick 2.1 imports
QtQuick 1.1 is not supported anymore. Change-Id: Ibfeba6f2e0617892ea823d1043344502e4617b7a Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -510,7 +510,7 @@ void tst_TestCore::testModelCreateRect()
|
|||||||
void tst_TestCore::testRewriterDynamicProperties()
|
void tst_TestCore::testRewriterDynamicProperties()
|
||||||
{
|
{
|
||||||
const QLatin1String qmlString("\n"
|
const QLatin1String qmlString("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Rectangle {\n"
|
"Rectangle {\n"
|
||||||
" property int i\n"
|
" property int i\n"
|
||||||
@@ -646,7 +646,7 @@ void tst_TestCore::testRewriterDynamicProperties()
|
|||||||
void tst_TestCore::testRewriterGroupedProperties()
|
void tst_TestCore::testRewriterGroupedProperties()
|
||||||
{
|
{
|
||||||
const QLatin1String qmlString("\n"
|
const QLatin1String qmlString("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Text {\n"
|
"Text {\n"
|
||||||
" font {\n"
|
" font {\n"
|
||||||
@@ -683,7 +683,7 @@ void tst_TestCore::testRewriterGroupedProperties()
|
|||||||
|
|
||||||
rootModelNode.removeProperty("font.pointSize");
|
rootModelNode.removeProperty("font.pointSize");
|
||||||
const QLatin1String expected("\n"
|
const QLatin1String expected("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Text {\n"
|
"Text {\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
@@ -694,7 +694,7 @@ void tst_TestCore::testRewriterGroupedProperties()
|
|||||||
void tst_TestCore::testRewriterPreserveOrder()
|
void tst_TestCore::testRewriterPreserveOrder()
|
||||||
{
|
{
|
||||||
const QLatin1String qmlString1("\n"
|
const QLatin1String qmlString1("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Rectangle {\n"
|
"Rectangle {\n"
|
||||||
"width: 640\n"
|
"width: 640\n"
|
||||||
@@ -715,7 +715,7 @@ void tst_TestCore::testRewriterPreserveOrder()
|
|||||||
"}\n"
|
"}\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
const QLatin1String qmlString2("\n"
|
const QLatin1String qmlString2("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Rectangle {\n"
|
"Rectangle {\n"
|
||||||
"width: 640\n"
|
"width: 640\n"
|
||||||
@@ -810,7 +810,7 @@ void tst_TestCore::testRewriterPreserveOrder()
|
|||||||
void tst_TestCore::testRewriterActionCompression()
|
void tst_TestCore::testRewriterActionCompression()
|
||||||
{
|
{
|
||||||
const QLatin1String qmlString("\n"
|
const QLatin1String qmlString("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Rectangle {\n"
|
"Rectangle {\n"
|
||||||
" id: root\n"
|
" id: root\n"
|
||||||
@@ -856,7 +856,7 @@ void tst_TestCore::testRewriterActionCompression()
|
|||||||
transaction.commit();
|
transaction.commit();
|
||||||
|
|
||||||
const QLatin1String expected("\n"
|
const QLatin1String expected("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Rectangle {\n"
|
"Rectangle {\n"
|
||||||
" id: root\n"
|
" id: root\n"
|
||||||
@@ -923,7 +923,7 @@ void tst_TestCore::testRewriterImports()
|
|||||||
void tst_TestCore::testRewriterChangeImports()
|
void tst_TestCore::testRewriterChangeImports()
|
||||||
{
|
{
|
||||||
const QLatin1String qmlString("\n"
|
const QLatin1String qmlString("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Rectangle {}\n");
|
"Rectangle {}\n");
|
||||||
|
|
||||||
@@ -950,7 +950,7 @@ void tst_TestCore::testRewriterChangeImports()
|
|||||||
model->changeImports(importList, QList<Import>());
|
model->changeImports(importList, QList<Import>());
|
||||||
|
|
||||||
const QLatin1String qmlWithImport("\n"
|
const QLatin1String qmlWithImport("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"import QtWebKit 1.0\n"
|
"import QtWebKit 1.0\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Rectangle {}\n");
|
"Rectangle {}\n");
|
||||||
@@ -959,7 +959,7 @@ void tst_TestCore::testRewriterChangeImports()
|
|||||||
model->changeImports(QList<Import>(), importList);
|
model->changeImports(QList<Import>(), importList);
|
||||||
|
|
||||||
QCOMPARE(model->imports().size(), 1);
|
QCOMPARE(model->imports().size(), 1);
|
||||||
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
|
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "2.1"));
|
||||||
|
|
||||||
QCOMPARE(textEdit.toPlainText(), qmlString);
|
QCOMPARE(textEdit.toPlainText(), qmlString);
|
||||||
|
|
||||||
@@ -973,14 +973,14 @@ void tst_TestCore::testRewriterChangeImports()
|
|||||||
model->changeImports(QList<Import>() << webkitImportAlias, QList<Import>() << webkitImport);
|
model->changeImports(QList<Import>() << webkitImportAlias, QList<Import>() << webkitImport);
|
||||||
|
|
||||||
const QLatin1String qmlWithAliasImport("\n"
|
const QLatin1String qmlWithAliasImport("\n"
|
||||||
"import QtQuick 1.1\n"
|
"import QtQuick 2.1\n"
|
||||||
"import QtWebKit 1.0 as Web\n"
|
"import QtWebKit 1.0 as Web\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Rectangle {}\n");
|
"Rectangle {}\n");
|
||||||
QCOMPARE(textEdit.toPlainText(), qmlWithAliasImport);
|
QCOMPARE(textEdit.toPlainText(), qmlWithAliasImport);
|
||||||
|
|
||||||
model->changeImports(QList<Import>(), QList<Import>() << webkitImportAlias);
|
model->changeImports(QList<Import>(), QList<Import>() << webkitImportAlias);
|
||||||
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
|
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "2.1"));
|
||||||
|
|
||||||
QCOMPARE(textEdit.toPlainText(), qmlString);
|
QCOMPARE(textEdit.toPlainText(), qmlString);
|
||||||
|
|
||||||
@@ -989,17 +989,17 @@ void tst_TestCore::testRewriterChangeImports()
|
|||||||
//
|
//
|
||||||
textEdit.setPlainText(qmlWithImport);
|
textEdit.setPlainText(qmlWithImport);
|
||||||
QCOMPARE(model->imports().size(), 2);
|
QCOMPARE(model->imports().size(), 2);
|
||||||
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
|
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "2.1"));
|
||||||
QCOMPARE(model->imports().last(), Import::createLibraryImport("QtWebKit", "1.0"));
|
QCOMPARE(model->imports().last(), Import::createLibraryImport("QtWebKit", "1.0"));
|
||||||
|
|
||||||
textEdit.setPlainText(qmlWithAliasImport);
|
textEdit.setPlainText(qmlWithAliasImport);
|
||||||
QCOMPARE(model->imports().size(), 2);
|
QCOMPARE(model->imports().size(), 2);
|
||||||
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
|
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "2.1"));
|
||||||
QCOMPARE(model->imports().last(), Import::createLibraryImport("QtWebKit", "1.0", "Web"));
|
QCOMPARE(model->imports().last(), Import::createLibraryImport("QtWebKit", "1.0", "Web"));
|
||||||
|
|
||||||
textEdit.setPlainText(qmlString);
|
textEdit.setPlainText(qmlString);
|
||||||
QCOMPARE(model->imports().size(), 1);
|
QCOMPARE(model->imports().size(), 1);
|
||||||
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
|
QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "2.1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_TestCore::testRewriterUnicodeChars()
|
void tst_TestCore::testRewriterUnicodeChars()
|
||||||
@@ -4120,7 +4120,7 @@ void tst_TestCore::testAnchorsAndRewritingCenter()
|
|||||||
|
|
||||||
void tst_TestCore::loadQml()
|
void tst_TestCore::loadQml()
|
||||||
{
|
{
|
||||||
char qmlString[] = "import QtQuick 2.1\n"
|
char qmlString[] = "import QtQuick 2.15\n"
|
||||||
"Rectangle {\n"
|
"Rectangle {\n"
|
||||||
"id: root;\n"
|
"id: root;\n"
|
||||||
"width: 200;\n"
|
"width: 200;\n"
|
||||||
@@ -7749,8 +7749,6 @@ void tst_TestCore::testRewriterNodeReparenting()
|
|||||||
" }\n"
|
" }\n"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
QCOMPARE(textEdit.toPlainText(), expected);
|
|
||||||
|
|
||||||
QCOMPARE(stripWhiteSpaces(textEdit.toPlainText()), stripWhiteSpaces(expected));
|
QCOMPARE(stripWhiteSpaces(textEdit.toPlainText()), stripWhiteSpaces(expected));
|
||||||
|
|
||||||
// reparent out of the hierarchy
|
// reparent out of the hierarchy
|
||||||
|
Reference in New Issue
Block a user