aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Benelli <marco.benelli@qt.io>2018-02-19 12:26:51 +0100
committerMarco Benelli <marco.benelli@qt.io>2018-04-03 14:40:30 +0000
commitb9d72a57376e7a41de2320f40363372248ebce21 (patch)
treee3ff500dd372b9fdbfeb190e07488225f3db3551
parent4e4a07ea1d0390660588facd033a8890a0c13e39 (diff)
qmljs: remove remaining references to QtQuick1
This patch removes all references to QtQuick1 in qml library, plugin, designer, profiler and tests. Change-Id: Ie286fad96060299caae3ef328330597cf53e90d3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--doc/src/editors/creator-editors.qdoc10
-rw-r--r--src/libs/qmljs/qmljscheck.cpp7
-rw-r--r--src/libs/qmljs/qmljsconstants.h1
-rw-r--r--src/libs/qmljs/qmljsdialect.cpp13
-rw-r--r--src/libs/qmljs/qmljsdialect.h1
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.cpp28
-rw-r--r--src/libs/qmljs/qmljsplugindumper.cpp7
-rw-r--r--src/libs/qmljs/qmljsstaticanalysismessage.cpp2
-rw-r--r--src/libs/qmljs/qmljsstaticanalysismessage.h3
-rw-r--r--src/libs/qmljs/qmljsviewercontext.cpp5
-rw-r--r--src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp8
-rw-r--r--src/plugins/qmldesigner/qmldesignerplugin.cpp3
-rw-r--r--src/plugins/qmljstools/qmljsbundleprovider.cpp10
-rw-r--r--src/plugins/qmljstools/qmljsbundleprovider.h2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp3
-rw-r--r--tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp2
-rw-r--r--tests/auto/qml/qmldesigner/coretests/tst_testcore.h2
17 files changed, 15 insertions, 92 deletions
diff --git a/doc/src/editors/creator-editors.qdoc b/doc/src/editors/creator-editors.qdoc
index 603752dba8..7a6503fb99 100644
--- a/doc/src/editors/creator-editors.qdoc
+++ b/doc/src/editors/creator-editors.qdoc
@@ -803,16 +803,6 @@
\l{http://linterrors.com/js/the-array-literal-notation-is-preferrable}
{The array literal notation [] is preferable}.
- \row
- \li M324
- \li Warning
- \li Using Qt Quick 1 code model instead of Qt Quick 2
- \li The code model might be corrupt or the QML emulation layer might
- have been built with a different Qt version than the one selected in
- the build and run kit. For more information, see
- \l {Resetting the Code Model} and
- \l {Running QML Modules in Qt Quick Designer}.
-
\endtable
\section1 Resetting the Code Model
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp
index 1acedaf4a0..805700f942 100644
--- a/src/libs/qmljs/qmljscheck.cpp
+++ b/src/libs/qmljs/qmljscheck.cpp
@@ -676,7 +676,6 @@ void Check::enableQmlDesignerChecks()
enableMessage(WarnImperativeCodeNotEditableInVisualDesigner);
enableMessage(WarnUnsupportedTypeInVisualDesigner);
enableMessage(WarnReferenceToParentItemNotSupportedByVisualDesigner);
- enableMessage(WarnAboutQtQuick1InsteadQtQuick2);
enableMessage(ErrUnsupportedRootTypeInVisualDesigner);
enableMessage(ErrInvalidIdeInVisualDesigner);
//## triggers too often ## check.enableMessage(StaticAnalysis::WarnUndefinedValueForVisualDesigner);
@@ -910,12 +909,6 @@ void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId,
if (iter.error() != PrototypeIterator::NoError)
typeError = true;
const ObjectValue *lastPrototype = prototypes.last();
- foreach (const ObjectValue *objectValue, prototypes) {
- if (objectValue->className() == QLatin1String("QGraphicsObject")
- && _isQtQuick2) {
- addMessage(WarnAboutQtQuick1InsteadQtQuick2, typeErrorLocation);
- }
- }
if (iter.error() == PrototypeIterator::ReferenceResolutionError) {
if (const QmlPrototypeReference *ref =
diff --git a/src/libs/qmljs/qmljsconstants.h b/src/libs/qmljs/qmljsconstants.h
index 9cbf9fb19b..b98db27a32 100644
--- a/src/libs/qmljs/qmljsconstants.h
+++ b/src/libs/qmljs/qmljsconstants.h
@@ -72,7 +72,6 @@ enum Enum
JavaScript = 1,
Json = 2,
Qml = 3,
- QmlQtQuick1 = 4,
QmlQtQuick2 = 5,
QmlQbs = 6,
QmlProject = 7,
diff --git a/src/libs/qmljs/qmljsdialect.cpp b/src/libs/qmljs/qmljsdialect.cpp
index 9746490871..0cb463b2e5 100644
--- a/src/libs/qmljs/qmljsdialect.cpp
+++ b/src/libs/qmljs/qmljsdialect.cpp
@@ -35,7 +35,6 @@ bool Dialect::isQmlLikeLanguage() const
{
switch (m_dialect) {
case Dialect::Qml:
- case Dialect::QmlQtQuick1:
case Dialect::QmlQtQuick2:
case Dialect::QmlQtQuick2Ui:
case Dialect::QmlQbs:
@@ -54,7 +53,6 @@ bool Dialect::isFullySupportedLanguage() const
case Dialect::JavaScript:
case Dialect::Json:
case Dialect::Qml:
- case Dialect::QmlQtQuick1:
case Dialect::QmlQtQuick2:
case Dialect::QmlQtQuick2Ui:
return true;
@@ -72,7 +70,6 @@ bool Dialect::isQmlLikeOrJsLanguage() const
{
switch (m_dialect) {
case Dialect::Qml:
- case Dialect::QmlQtQuick1:
case Dialect::QmlQtQuick2:
case Dialect::QmlQtQuick2Ui:
case Dialect::QmlQbs:
@@ -95,8 +92,6 @@ QString Dialect::toString() const
return QLatin1String("Json");
case Dialect::Qml:
return QLatin1String("Qml");
- case Dialect::QmlQtQuick1:
- return QLatin1String("QmlQtQuick1");
case Dialect::QmlQtQuick2:
return QLatin1String("QmlQtQuick2");
case Dialect::QmlQtQuick2Ui:
@@ -206,11 +201,7 @@ QList<Dialect> Dialect::companionLanguages() const
langs << Dialect::JavaScript;
break;
case Dialect::Qml:
- langs << Dialect::QmlQtQuick1 << Dialect::QmlQtQuick2 << Dialect::QmlQtQuick2Ui
- << Dialect::JavaScript;
- break;
- case Dialect::QmlQtQuick1:
- langs << Dialect::Qml << Dialect::JavaScript;
+ langs << Dialect::QmlQtQuick2 << Dialect::QmlQtQuick2Ui << Dialect::JavaScript;
break;
case Dialect::QmlQtQuick2:
case Dialect::QmlQtQuick2Ui:
@@ -220,7 +211,7 @@ QList<Dialect> Dialect::companionLanguages() const
break;
case Dialect::AnyLanguage:
langs << Dialect::JavaScript << Dialect::Json << Dialect::QmlProject << Dialect:: QmlQbs
- << Dialect::QmlTypeInfo << Dialect::QmlQtQuick1 << Dialect::QmlQtQuick2
+ << Dialect::QmlTypeInfo << Dialect::QmlQtQuick2
<< Dialect::QmlQtQuick2Ui << Dialect::Qml;
break;
case Dialect::NoLanguage:
diff --git a/src/libs/qmljs/qmljsdialect.h b/src/libs/qmljs/qmljsdialect.h
index 4feb8f7816..8d1ca30deb 100644
--- a/src/libs/qmljs/qmljsdialect.h
+++ b/src/libs/qmljs/qmljsdialect.h
@@ -41,7 +41,6 @@ public:
JavaScript = 1,
Json = 2,
Qml = 3,
- QmlQtQuick1 = 4,
QmlQtQuick2 = 5,
QmlQbs = 6,
QmlProject = 7,
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
index b14bd39a52..79ae1d59e9 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
@@ -869,7 +869,7 @@ void ModelManagerInterface::parseLoop(QSet<QString> &scannedPaths,
continue;
}
if (language == Dialect::Qml
- && (mainLanguage == Dialect::QmlQtQuick1 || mainLanguage == Dialect::QmlQtQuick2))
+ && (mainLanguage == Dialect::QmlQtQuick2))
language = mainLanguage;
if (language == Dialect::Qml && mainLanguage == Dialect::QmlQtQuick2Ui)
language = Dialect::QmlQtQuick2;
@@ -1146,18 +1146,7 @@ void ModelManagerInterface::updateImportPaths()
if (!pathAtt.isEmpty())
allImportPaths.maybeInsert(Utils::FileName::fromString(pathAtt), Dialect::QmlQtQuick2);
}
- pInfoIter.toFront();
- while (pInfoIter.hasNext()) {
- pInfoIter.next();
- QString pathAtt = pInfoIter.value().qtImportsPath;
- if (!pathAtt.isEmpty())
- allImportPaths.maybeInsert(Utils::FileName::fromString(pathAtt), Dialect::QmlQtQuick1);
- }
- {
- QString pathAtt = defaultProjectInfo().qtImportsPath;
- if (!pathAtt.isEmpty())
- allImportPaths.maybeInsert(Utils::FileName::fromString(pathAtt), Dialect::QmlQtQuick1);
- }
+
foreach (const QString &path, m_defaultImportPaths)
allImportPaths.maybeInsert(Utils::FileName::fromString(path), Dialect::Qml);
allImportPaths.compact();
@@ -1374,8 +1363,7 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
if (!doc.isNull()
&& ((vCtx.language == Dialect::AnyLanguage && doc->language() != Dialect::NoLanguage)
|| (vCtx.language == Dialect::Qml
- && (doc->language() == Dialect::QmlQtQuick1
- || doc->language() == Dialect::QmlQtQuick2
+ && (doc->language() == Dialect::QmlQtQuick2
|| doc->language() == Dialect::QmlQtQuick2Ui))))
res.language = doc->language();
ProjectInfo info;
@@ -1401,8 +1389,6 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
case Dialect::AnyLanguage:
case Dialect::Qml:
res.maybeAddPath(info.qtQmlPath);
- Q_FALLTHROUGH();
- case Dialect::QmlQtQuick1:
res.maybeAddPath(info.qtImportsPath);
Q_FALLTHROUGH();
case Dialect::QmlQtQuick2:
@@ -1447,12 +1433,10 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
if (res.language == Dialect::AnyLanguage || res.language == Dialect::Qml
|| res.language == Dialect::QmlQtQuick2 || res.language == Dialect::QmlQtQuick2Ui)
res.maybeAddPath(info.qtImportsPath);
- if (res.language == Dialect::AnyLanguage || res.language == Dialect::Qml
- || res.language == Dialect::QmlQtQuick1)
+ if (res.language == Dialect::AnyLanguage || res.language == Dialect::Qml)
res.maybeAddPath(info.qtQmlPath);
if (res.language == Dialect::AnyLanguage || res.language == Dialect::Qml
- || res.language == Dialect::QmlQtQuick1 || res.language == Dialect::QmlQtQuick2
- || res.language == Dialect::QmlQtQuick2Ui) {
+ || res.language == Dialect::QmlQtQuick2 || res.language == Dialect::QmlQtQuick2Ui) {
foreach (const QString &path, environmentImportPaths())
res.maybeAddPath(path);
}
@@ -1470,7 +1454,7 @@ ViewerContext ModelManagerInterface::defaultVContext(Dialect language,
if (language == Dialect::AnyLanguage && doc->language() != Dialect::NoLanguage)
language = doc->language();
else if (language == Dialect::Qml &&
- (doc->language() == Dialect::QmlQtQuick1 || doc->language() == Dialect::QmlQtQuick2
+ (doc->language() == Dialect::QmlQtQuick2
|| doc->language() == Dialect::QmlQtQuick2Ui))
language = doc->language();
}
diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp
index 7ada84f28b..e8bd19a906 100644
--- a/src/libs/qmljs/qmljsplugindumper.cpp
+++ b/src/libs/qmljs/qmljsplugindumper.cpp
@@ -116,13 +116,6 @@ void PluginDumper::onLoadBuiltinTypes(const QmlJS::ModelManagerInterface::Projec
loadQmltypesFile(QStringList(builtinQmltypesPath), baseImportsPath, builtinInfo);
return;
}
- // QTDIR/imports/QtQuick1/builtins.qmltypes was used in developer builds of 5.0.0, 5.0.1
- const QString builtinQmltypesPath2 = info.qtImportsPath
- + QLatin1String("/QtQuick1/builtins.qmltypes");
- if (QFile::exists(builtinQmltypesPath2)) {
- loadQmltypesFile(QStringList(builtinQmltypesPath2), baseImportsPath, builtinInfo);
- return;
- }
runQmlDump(info, QStringList(QLatin1String("--builtins")), baseImportsPath);
m_qtToInfo.insert(baseImportsPath, info);
diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.cpp b/src/libs/qmljs/qmljsstaticanalysismessage.cpp
index 0de66fd1c5..a9677bb373 100644
--- a/src/libs/qmljs/qmljsstaticanalysismessage.cpp
+++ b/src/libs/qmljs/qmljsstaticanalysismessage.cpp
@@ -222,8 +222,6 @@ StaticAnalysisMessages::StaticAnalysisMessages()
tr("Qt Quick Designer only supports states in the root item."));
newMsg(ErrInvalidIdeInVisualDesigner, Error,
tr("This id might be ambiguous and is not supported in the Qt Quick Designer."));
- newMsg(WarnAboutQtQuick1InsteadQtQuick2, Warning,
- tr("Using Qt Quick 1 code model instead of Qt Quick 2."));
newMsg(ErrUnsupportedRootTypeInVisualDesigner, Error,
tr("This type (%1) is not supported as a root element by Qt Quick Designer."), 1);
newMsg(ErrUnsupportedRootTypeInQmlUi, Error,
diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.h b/src/libs/qmljs/qmljsstaticanalysismessage.h
index 109a85a027..c66a30946b 100644
--- a/src/libs/qmljs/qmljsstaticanalysismessage.h
+++ b/src/libs/qmljs/qmljsstaticanalysismessage.h
@@ -128,8 +128,7 @@ enum Type
ErrInvalidStringValuePattern = 320,
ErrLongerStringValueExpected = 321,
ErrShorterStringValueExpected = 322,
- ErrInvalidArrayValueLength = 323,
- WarnAboutQtQuick1InsteadQtQuick2 = 324
+ ErrInvalidArrayValueLength = 323
};
class QMLJS_EXPORT PrototypeMessageData {
diff --git a/src/libs/qmljs/qmljsviewercontext.cpp b/src/libs/qmljs/qmljsviewercontext.cpp
index d034432dc4..bc5d8e5b48 100644
--- a/src/libs/qmljs/qmljsviewercontext.cpp
+++ b/src/libs/qmljs/qmljsviewercontext.cpp
@@ -62,10 +62,7 @@ bool ViewerContext::languageIsCompatible(Dialect l) const
case Dialect::QmlTypeInfo:
return language == l;
case Dialect::Qml:
- return l == Dialect::Qml || l == Dialect::QmlQtQuick1 || l == Dialect::QmlQtQuick2
- || l == Dialect::JavaScript;
- case Dialect::QmlQtQuick1:
- return l == Dialect::Qml || l == Dialect::QmlQtQuick1 || l == Dialect::JavaScript;
+ return l == Dialect::Qml || l == Dialect::QmlQtQuick2 || l == Dialect::JavaScript;
case Dialect::QmlQtQuick2:
case Dialect::QmlQtQuick2Ui:
return l == Dialect::Qml || l == Dialect::QmlQtQuick2 || l == Dialect::QmlQtQuick2Ui
diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
index 013854c698..56023ee2bf 100644
--- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
+++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
@@ -2045,12 +2045,8 @@ void TextToModelMerger::collectSemanticErrorsAndWarnings(QList<DocumentMessage>
else
errors->append(DocumentMessage(message.toDiagnosticMessage(), fileNameUrl));
}
- if (message.severity == Severity::Warning) {
- if (message.type == StaticAnalysis::WarnAboutQtQuick1InsteadQtQuick2)
- errors->append(DocumentMessage(message.toDiagnosticMessage(), fileNameUrl));
- else
- warnings->append(DocumentMessage(message.toDiagnosticMessage(), fileNameUrl));
- }
+ if (message.severity == Severity::Warning)
+ warnings->append(DocumentMessage(message.toDiagnosticMessage(), fileNameUrl));
}
}
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp
index 1b81f80b28..c5710957da 100644
--- a/src/plugins/qmldesigner/qmldesignerplugin.cpp
+++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp
@@ -102,8 +102,7 @@ static bool checkIfEditorIsQtQuick(Core::IEditor *editor)
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
QmlJS::Document::Ptr document = modelManager->ensuredGetDocumentForPath(editor->document()->filePath().toString());
if (!document.isNull())
- return document->language() == QmlJS::Dialect::QmlQtQuick1
- || document->language() == QmlJS::Dialect::QmlQtQuick2
+ return document->language() == QmlJS::Dialect::QmlQtQuick2
|| document->language() == QmlJS::Dialect::QmlQtQuick2Ui
|| document->language() == QmlJS::Dialect::Qml;
diff --git a/src/plugins/qmljstools/qmljsbundleprovider.cpp b/src/plugins/qmljstools/qmljsbundleprovider.cpp
index d73665f9da..b1058176af 100644
--- a/src/plugins/qmljstools/qmljsbundleprovider.cpp
+++ b/src/plugins/qmljstools/qmljsbundleprovider.cpp
@@ -68,16 +68,6 @@ QmlBundle BasicBundleProvider::defaultBundle(const QString &bundleInfoName)
return res;
}
-QmlBundle BasicBundleProvider::defaultQt4QtQuick1Bundle()
-{
- return defaultBundle(QLatin1String("qt4QtQuick1-bundle.json"));
-}
-
-QmlBundle BasicBundleProvider::defaultQt5QtQuick1Bundle()
-{
- return defaultBundle(QLatin1String("qt5QtQuick1-bundle.json"));
-}
-
QmlBundle BasicBundleProvider::defaultQt5QtQuick2Bundle()
{
return defaultBundle(QLatin1String("qt5QtQuick2-bundle.json"));
diff --git a/src/plugins/qmljstools/qmljsbundleprovider.h b/src/plugins/qmljstools/qmljsbundleprovider.h
index 8fc2258c69..a0bf3b4c3d 100644
--- a/src/plugins/qmljstools/qmljsbundleprovider.h
+++ b/src/plugins/qmljstools/qmljsbundleprovider.h
@@ -66,8 +66,6 @@ public:
, const QHash<QString,QString> &replacements);
static QmlJS::QmlBundle defaultBundle(const QString &bundleInfoName);
- static QmlJS::QmlBundle defaultQt4QtQuick1Bundle();
- static QmlJS::QmlBundle defaultQt5QtQuick1Bundle();
static QmlJS::QmlBundle defaultQt5QtQuick2Bundle();
static QmlJS::QmlBundle defaultQbsBundle();
static QmlJS::QmlBundle defaultQmltypesBundle();
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
index f64e3c9978..85b5e55784 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
@@ -411,9 +411,6 @@ static QString getInitialDetails(const QmlEventType &event)
details.startsWith(QLatin1String("qrc:/")))
details = details.mid(details.lastIndexOf(QLatin1Char('/')) + 1);
}
- } else if (event.rangeType() == Painting) {
- // QtQuick1 animations always run in GUI thread.
- details = QmlProfilerModelManager::tr("GUI Thread");
}
return details;
diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
index 6f8e390a05..4408e9fa19 100644
--- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
+++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
@@ -4198,7 +4198,7 @@ void tst_TestCore::testMetaInfoEnums()
QApplication::processEvents();
}
-void tst_TestCore::testMetaInfoQtQuick1Vs2()
+void tst_TestCore::testMetaInfoQtQuickVersion2()
{
char qmlString[] = "import QtQuick 2.0\n"
"Rectangle {\n"
diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.h b/tests/auto/qml/qmldesigner/coretests/tst_testcore.h
index def024c63f..cde63a12d1 100644
--- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.h
+++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.h
@@ -56,7 +56,7 @@ private slots:
void testMetaInfoEnums();
void testMetaInfoProperties();
void testMetaInfoDotProperties();
- void testMetaInfoQtQuick1Vs2();
+ void testMetaInfoQtQuickVersion2();
void testMetaInfoListProperties();
void testQtQuick20Basic();
void testQtQuick20BasicRectangle();