From 22ec44b5f3a09dc4aeda553924d379989fbbb43c Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 21 Apr 2022 16:42:40 +0200 Subject: [PATCH 1/4] Update qbs submodule ... to HEAD of 1.22 branch. Change-Id: I72ccdd5bd8070baf214a74df32c443f1ba87ac0c Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Christian Stenger --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 0ccbc9f30d3..b6a46aa0199 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 0ccbc9f30d3fc6994d6ec3a7db0ed60e2c9dc500 +Subproject commit b6a46aa0199c2595766495673f67a8190f3342fe From a3b1dfd34a4f3b5653beea4bb48f9731904f40ed Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Mon, 6 Dec 2021 09:44:24 +0100 Subject: [PATCH 2/4] qmljs: correctly handle js string templates In most cases we do want to visit the expressions in a function template. Changing its accept0 would force those not wanting to visit it to iterate on the templates (currently a linked list), so we add a visit method explicitly visiting the expression in all the needed places. Fixes: QTCREATORBUG-21869 Change-Id: I47733544bfd32eec357810b97242608b8f7de572 Reviewed-by: Eike Ziller Reviewed-by: Fabian Kosmale --- src/libs/qmljs/jsoncheck.cpp | 6 ++++++ src/libs/qmljs/jsoncheck.h | 1 + src/libs/qmljs/qmljsbind.cpp | 6 ++++++ src/libs/qmljs/qmljsbind.h | 1 + src/libs/qmljs/qmljscheck.cpp | 6 ++++++ src/libs/qmljs/qmljscheck.h | 1 + src/libs/qmljs/qmljsevaluate.cpp | 6 ++++++ src/libs/qmljs/qmljsevaluate.h | 1 + src/libs/qmljs/qmljsscopeastpath.cpp | 6 ++++++ src/libs/qmljs/qmljsscopeastpath.h | 1 + src/plugins/debugger/qml/qmlengineutils.cpp | 5 +++++ .../bindingeditor/connectionvisitor.cpp | 8 ++++++++ .../bindingeditor/connectionvisitor.h | 1 + .../componentcore/findimplementation.cpp | 6 ++++++ .../filemanager/firstdefinitionfinder.cpp | 6 ++++++ .../filemanager/firstdefinitionfinder.h | 1 + .../qmljseditor/qmljseditordocument.cpp | 13 +++++++++++++ .../qmljseditor/qmljsfindreferences.cpp | 18 ++++++++++++++++++ src/plugins/qmljstools/qmljssemanticinfo.cpp | 6 ++++++ 19 files changed, 99 insertions(+) diff --git a/src/libs/qmljs/jsoncheck.cpp b/src/libs/qmljs/jsoncheck.cpp index 966513c2085..3261b8b715b 100644 --- a/src/libs/qmljs/jsoncheck.cpp +++ b/src/libs/qmljs/jsoncheck.cpp @@ -84,6 +84,12 @@ void JsonCheck::postVisit(Node *) analysis()->m_ranking += previous.m_ranking; } +bool JsonCheck::visit(AST::TemplateLiteral *ast) +{ + Node::accept(ast->expression, this); + return true; +} + bool JsonCheck::visit(ObjectPattern *ast) { if (!proceedCheck(JsonValue::Object, ast->lbraceToken)) diff --git a/src/libs/qmljs/jsoncheck.h b/src/libs/qmljs/jsoncheck.h index 9885ad2353d..5a697b485c3 100644 --- a/src/libs/qmljs/jsoncheck.h +++ b/src/libs/qmljs/jsoncheck.h @@ -51,6 +51,7 @@ private: bool preVisit(AST::Node *) override; void postVisit(AST::Node *) override; + bool visit(AST::TemplateLiteral *ast) override; bool visit(AST::ObjectPattern *ast) override; bool visit(AST::ArrayPattern *ast) override; bool visit(AST::NullExpression *ast) override; diff --git a/src/libs/qmljs/qmljsbind.cpp b/src/libs/qmljs/qmljsbind.cpp index 96b0ee2908f..57b495af71f 100644 --- a/src/libs/qmljs/qmljsbind.cpp +++ b/src/libs/qmljs/qmljsbind.cpp @@ -350,6 +350,12 @@ bool Bind::visit(UiInlineComponent *ast) return true; } +bool Bind::visit(AST::TemplateLiteral *ast) +{ + Node::accept(ast->expression, this); + return true; +} + bool Bind::visit(PatternElement *ast) { if (ast->bindingIdentifier.isEmpty() || !ast->isVariableDeclaration()) diff --git a/src/libs/qmljs/qmljsbind.h b/src/libs/qmljs/qmljsbind.h index d1a90a6cfae..e531b4de467 100644 --- a/src/libs/qmljs/qmljsbind.h +++ b/src/libs/qmljs/qmljsbind.h @@ -82,6 +82,7 @@ protected: bool visit(AST::UiInlineComponent *ast) override; // QML/JS + bool visit(AST::TemplateLiteral *ast) override; bool visit(AST::FunctionDeclaration *ast) override; bool visit(AST::FunctionExpression *ast) override; bool visit(AST::PatternElement *ast) override; diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 519706c326d..a0ce17eac03 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -809,6 +809,12 @@ bool Check::visit(UiObjectInitializer *) return true; } +bool Check::visit(AST::TemplateLiteral *ast) +{ + Node::accept(ast->expression, this); + return true; +} + void Check::endVisit(UiObjectInitializer *uiObjectInitializer) { Q_UNUSED(uiObjectInitializer) diff --git a/src/libs/qmljs/qmljscheck.h b/src/libs/qmljs/qmljscheck.h index 10019a9794e..77d88d38e4a 100644 --- a/src/libs/qmljs/qmljscheck.h +++ b/src/libs/qmljs/qmljscheck.h @@ -77,6 +77,7 @@ protected: bool visit(AST::FunctionExpression *ast) override; bool visit(AST::UiObjectInitializer *) override; + bool visit(AST::TemplateLiteral *ast) override; bool visit(AST::BinaryExpression *ast) override; bool visit(AST::Block *ast) override; bool visit(AST::WithStatement *ast) override; diff --git a/src/libs/qmljs/qmljsevaluate.cpp b/src/libs/qmljs/qmljsevaluate.cpp index d2bb3c34605..e848d130b41 100644 --- a/src/libs/qmljs/qmljsevaluate.cpp +++ b/src/libs/qmljs/qmljsevaluate.cpp @@ -211,6 +211,12 @@ bool Evaluate::visit(AST::UiQualifiedId *ast) return false; } +bool Evaluate::visit(AST::TemplateLiteral *ast) +{ + _result = _valueOwner->stringValue(); + return false; +} + bool Evaluate::visit(AST::ThisExpression *) { return false; diff --git a/src/libs/qmljs/qmljsevaluate.h b/src/libs/qmljs/qmljsevaluate.h index 4cd37f56fed..a3c1cf13a5c 100644 --- a/src/libs/qmljs/qmljsevaluate.h +++ b/src/libs/qmljs/qmljsevaluate.h @@ -75,6 +75,7 @@ protected: bool visit(AST::UiQualifiedId *ast) override; // QmlJS + bool visit(AST::TemplateLiteral *ast) override; bool visit(AST::ThisExpression *ast) override; bool visit(AST::IdentifierExpression *ast) override; bool visit(AST::NullExpression *ast) override; diff --git a/src/libs/qmljs/qmljsscopeastpath.cpp b/src/libs/qmljs/qmljsscopeastpath.cpp index 953f4761e85..6753219e56a 100644 --- a/src/libs/qmljs/qmljsscopeastpath.cpp +++ b/src/libs/qmljs/qmljsscopeastpath.cpp @@ -61,6 +61,12 @@ bool ScopeAstPath::preVisit(Node *node) return true; } +bool ScopeAstPath::visit(AST::TemplateLiteral *node) +{ + Node::accept(node->expression, this); + return true; +} + bool ScopeAstPath::visit(UiPublicMember *node) { if (node && node->statement && node->statement->kind == node->Kind_Block diff --git a/src/libs/qmljs/qmljsscopeastpath.h b/src/libs/qmljs/qmljsscopeastpath.h index 61ffb5a0f64..8e7a6a42393 100644 --- a/src/libs/qmljs/qmljsscopeastpath.h +++ b/src/libs/qmljs/qmljsscopeastpath.h @@ -44,6 +44,7 @@ protected: using Visitor::visit; bool preVisit(AST::Node *node) override; + bool visit(AST::TemplateLiteral *node) override; bool visit(AST::UiPublicMember *node) override; bool visit(AST::UiScriptBinding *node) override; bool visit(AST::UiObjectDefinition *node) override; diff --git a/src/plugins/debugger/qml/qmlengineutils.cpp b/src/plugins/debugger/qml/qmlengineutils.cpp index f7e22d127a0..5b5bef2a86f 100644 --- a/src/plugins/debugger/qml/qmlengineutils.cpp +++ b/src/plugins/debugger/qml/qmlengineutils.cpp @@ -158,6 +158,11 @@ public: return true; } + bool visit(TemplateLiteral *ast) override + { + Node::accept(ast->expression, this); + return true; + } bool visit(VariableStatement *ast) override { test(ast); return true; } bool visit(VariableDeclarationList *ast) override { test(ast); return true; } bool visit(ExpressionStatement *ast) override { test(ast); return true; } diff --git a/src/plugins/qmldesigner/components/bindingeditor/connectionvisitor.cpp b/src/plugins/qmldesigner/components/bindingeditor/connectionvisitor.cpp index ddf328978f0..8a1195ece44 100644 --- a/src/plugins/qmldesigner/components/bindingeditor/connectionvisitor.cpp +++ b/src/plugins/qmldesigner/components/bindingeditor/connectionvisitor.cpp @@ -31,6 +31,14 @@ ConnectionVisitor::ConnectionVisitor() { } +bool ConnectionVisitor::visit(QmlJS::AST::TemplateLiteral *ast) +{ + m_expression.append( + qMakePair(QmlJS::AST::Node::Kind::Kind_StringLiteral, ast->value.toString())); + QmlJS::AST::Node::accept(ast->expression, this); + return true; +} + bool ConnectionVisitor::visit(QmlJS::AST::StringLiteral *ast) { m_expression.append(qMakePair(QmlJS::AST::Node::Kind::Kind_StringLiteral, diff --git a/src/plugins/qmldesigner/components/bindingeditor/connectionvisitor.h b/src/plugins/qmldesigner/components/bindingeditor/connectionvisitor.h index abcebcdb8e0..0862ee5cca2 100644 --- a/src/plugins/qmldesigner/components/bindingeditor/connectionvisitor.h +++ b/src/plugins/qmldesigner/components/bindingeditor/connectionvisitor.h @@ -37,6 +37,7 @@ class ConnectionVisitor : public QmlJS::AST::Visitor public: explicit ConnectionVisitor(); + bool visit(QmlJS::AST::TemplateLiteral *ast) override; bool visit(QmlJS::AST::StringLiteral *ast) override; bool visit(QmlJS::AST::NumericLiteral *ast) override; bool visit(QmlJS::AST::TrueLiteral *ast) override; diff --git a/src/plugins/qmldesigner/components/componentcore/findimplementation.cpp b/src/plugins/qmldesigner/components/componentcore/findimplementation.cpp index 1838a3d4e9d..d0a1bca4fd6 100644 --- a/src/plugins/qmldesigner/components/componentcore/findimplementation.cpp +++ b/src/plugins/qmldesigner/components/componentcore/findimplementation.cpp @@ -148,6 +148,12 @@ protected: return true; } + bool visit(AST::TemplateLiteral *node) override + { + AST::Node::accept(node->expression, this); + return true; + } + bool visit(AST::IdentifierExpression *node) override { if (node->name != m_typeName) diff --git a/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.cpp b/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.cpp index 7fe59053da6..82e4c15ef41 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.cpp +++ b/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.cpp @@ -99,6 +99,12 @@ bool FirstDefinitionFinder::visit(QmlJS::AST::UiObjectDefinition *ast) return true; } +bool FirstDefinitionFinder::visit(QmlJS::AST::TemplateLiteral *ast) +{ + QmlJS::AST::Node::accept(ast->expression, this); + return true; +} + void FirstDefinitionFinder::throwRecursionDepthError() { qWarning("Warning: Hit maximum recursion depth while visiting the AST in FirstDefinitionFinder"); diff --git a/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.h b/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.h index 2a963ae2fbf..26d0c419ca6 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.h +++ b/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.h @@ -42,6 +42,7 @@ protected: bool visit(QmlJS::AST::UiObjectBinding *ast) override; bool visit(QmlJS::AST::UiObjectDefinition *ast) override; + bool visit(QmlJS::AST::TemplateLiteral *ast) override; void throwRecursionDepthError() override; diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 770f79aa044..5a930b1d649 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -279,6 +279,13 @@ protected: --_depth; } + bool visit(AST::TemplateLiteral *ast) override + { + // avoid? finds function declarations in templates + AST::Node::accept(ast->expression, this); + return true; + } + bool visit(AST::FunctionExpression *) override { return false; @@ -398,6 +405,12 @@ protected: return true; } + bool visit(AST::TemplateLiteral *ast) override + { + AST::Node::accept(ast->expression, this); + return true; + } + bool visit(AST::FunctionDeclaration *ast) override { _ranges.append(createRange(ast)); diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp index 5f7a9a33eac..7c02a5da291 100644 --- a/src/plugins/qmljseditor/qmljsfindreferences.cpp +++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp @@ -118,6 +118,12 @@ protected: return false; } + bool visit(AST::TemplateLiteral *el) override + { + Node::accept(el->expression, this); + return true; + } + bool visit(AST::UiObjectBinding *node) override { if (node->qualifiedId @@ -398,6 +404,12 @@ protected: return true; } + bool visit(AST::TemplateLiteral *el) override + { + Node::accept(el->expression, this); + return true; + } + bool visit(AST::FunctionDeclaration *node) override { return visit(static_cast(node)); @@ -557,6 +569,12 @@ protected: return true; } + bool visit(AST::TemplateLiteral *el) override + { + Node::accept(el->expression, this); + return true; + } + bool visit(UiScriptBinding *node) override { return !checkBindingName(node->qualifiedId); diff --git a/src/plugins/qmljstools/qmljssemanticinfo.cpp b/src/plugins/qmljstools/qmljssemanticinfo.cpp index ef375b77b7e..b136747e7a0 100644 --- a/src/plugins/qmljstools/qmljssemanticinfo.cpp +++ b/src/plugins/qmljstools/qmljssemanticinfo.cpp @@ -127,6 +127,12 @@ protected: return handleLocationAst(ast); } + bool visit(AST::TemplateLiteral *ast) override + { + AST::Node::accept(ast->expression, this); + return true; + } + void throwRecursionDepthError() override { qWarning("Warning: Hit maximum recursion depth when visiting the AST in AstPath"); From e4105330abd963cdafb2ecc4c7351149579c87c9 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 22 Apr 2022 13:31:40 +0200 Subject: [PATCH 3/4] QmlDesigner: Compile fix with namespaced Qt Amends 45ca3e030bf. Change-Id: I91956803ffebbb118a1d891e6bc433a370515248 Reviewed-by: Christian Stenger --- .../qmldesigner/components/navigator/navigatorsearchwidget.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qmldesigner/components/navigator/navigatorsearchwidget.h b/src/plugins/qmldesigner/components/navigator/navigatorsearchwidget.h index f96c3202ace..39ea601cb18 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorsearchwidget.h +++ b/src/plugins/qmldesigner/components/navigator/navigatorsearchwidget.h @@ -27,7 +27,9 @@ #include +QT_BEGIN_NAMESPACE class QToolButton; +QT_END_NAMESPACE namespace QmlDesigner { From 3a1eda28b928ea33e5106535935606c1edab5823 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 22 Apr 2022 09:24:16 +0200 Subject: [PATCH 4/4] Add trademark info to about dialog Fixes: QTCREATORBUG-27410 Change-Id: I496c7088cdcab68ba007ab1e43bcf7bfed8955f6 Reviewed-by: Reviewed-by: Leena Miettinen Reviewed-by: hjk --- src/plugins/coreplugin/versiondialog.cpp | 42 +++++++++++++----------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 14553cdcfc1..5e91fd164eb 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -73,25 +73,29 @@ VersionDialog::VersionDialog(QWidget *parent) const QString additionalInfo = QStringList(Utils::transform(additionalInfoLines, &QString::toHtmlEscaped)).join(br); - const QString description = tr( - "

%1

" - "%2
" - "%3" - "%4" - "%5" - "
" - "Copyright 2008-%6 %7. All rights reserved.
" - "
" - "The program is provided AS IS with NO WARRANTY OF ANY KIND, " - "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " - "PARTICULAR PURPOSE.
") - .arg(ICore::versionString(), - ICore::buildCompatibilityString(), - buildDateInfo, - ideRev, - additionalInfo.isEmpty() ? QString() : br + additionalInfo + br, - QLatin1String(Constants::IDE_YEAR), - QLatin1String(Constants::IDE_AUTHOR)); + const QString description + = tr("

%1

" + "%2
" + "%3" + "%4" + "%5" + "
" + "Copyright 2008-%6 %7. All rights reserved.
" + "
" + "The program is provided AS IS with NO WARRANTY OF ANY KIND, " + "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " + "PARTICULAR PURPOSE.
") + .arg(ICore::versionString(), + ICore::buildCompatibilityString(), + buildDateInfo, + ideRev, + additionalInfo.isEmpty() ? QString() : br + additionalInfo + br, + QLatin1String(Constants::IDE_YEAR), + QLatin1String(Constants::IDE_AUTHOR)) + + "
" + + tr("The Qt logo as well as Qt®, Qt Quick®, Built with Qt®, Boot to Qt®, " + "Qt Quick Compiler®, Qt Enterprise®, Qt Mobile® and Qt Embedded® are " + "registered trademarks of The Qt Company Ltd."); QLabel *copyRightLabel = new QLabel(description); copyRightLabel->setWordWrap(true);