From 5139c04c210199836b35d305933e3953c327c5ed Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 14 May 2021 13:21:18 +0200 Subject: [PATCH 01/15] ResourceEditor: Do not lose the compress-algo attribute ...when editing via the UI. Fixes: QTCREATORBUG-25706 Change-Id: I6ffef2d79188e42182dcb680a22f8b3b933a61e2 Reviewed-by: hjk --- src/plugins/resourceeditor/qrceditor/resourcefile.cpp | 3 +++ src/plugins/resourceeditor/qrceditor/resourcefile_p.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index 98306e45ec7..88b86ff9b41 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -190,6 +190,7 @@ Core::IDocument::OpenResult ResourceFile::load() const QString alias = felt.attribute(QLatin1String("alias")); File * const file = new File(p, fileName, alias); file->compress = felt.attribute(QLatin1String("compress")); + file->compressAlgo = felt.attribute(QLatin1String("compress-algo")); file->threshold = felt.attribute(QLatin1String("threshold")); p->file_list.append(file); } @@ -226,6 +227,8 @@ QString ResourceFile::contents() const felt.setAttribute(QLatin1String("alias"), file.alias); if (!file.compress.isEmpty()) felt.setAttribute(QLatin1String("compress"), file.compress); + if (!file.compressAlgo.isEmpty()) + felt.setAttribute(QLatin1String("compress-algo"), file.compressAlgo); if (!file.threshold.isEmpty()) felt.setAttribute(QLatin1String("threshold"), file.threshold); } diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h index 0afb55290cf..a48fa402f14 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h +++ b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h @@ -84,6 +84,7 @@ public: // not used, only loaded and saved QString compress; + QString compressAlgo; QString threshold; private: From ba83b852b63a0085fb221fbc755348fd4bff6906 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 17 May 2021 10:13:31 +0200 Subject: [PATCH 02/15] Editor: Close function hint proposal on destroyContext Fixes: QTCREATORBUG-25691 Change-Id: I2cb1b52fdda386cbfe3ca7f54746edd3e5562ea0 Reviewed-by: Christian Kandeler --- src/plugins/texteditor/codeassist/codeassistant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index 7439980df31..0614fbd2c73 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -482,7 +482,7 @@ void CodeAssistantPrivate::destroyContext() cancelCurrentRequest(); } else if (m_proposalWidget) { m_editorWidget->keepAutoCompletionHighlight(false); - if (m_proposalWidget->isVisible()) + if (m_proposalWidget->proposalIsVisible()) m_proposalWidget->closeProposal(); disconnect(m_proposalWidget, &QObject::destroyed, this, &CodeAssistantPrivate::finalizeProposal); From 2182993b9734b2a4f1d7e7972637b335200591f4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 14 May 2021 11:28:29 +0200 Subject: [PATCH 03/15] clangbackend: Add another exception to our "find real cursor" heuristic Leave preprocessor directives alone. Fixes: QTCREATORBUG-25692 Change-Id: I1c31f4120e9b86a58123f8877cebd354e800fb8b Reviewed-by: Christian Stenger --- src/tools/clangbackend/source/tokeninfo.cpp | 4 +++- tests/unit/unittest/data/highlightingmarks.cpp | 4 ++++ tests/unit/unittest/tokenprocessor-test.cpp | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/tools/clangbackend/source/tokeninfo.cpp b/src/tools/clangbackend/source/tokeninfo.cpp index 8e380b639c7..76f6595a66d 100644 --- a/src/tools/clangbackend/source/tokeninfo.cpp +++ b/src/tools/clangbackend/source/tokeninfo.cpp @@ -380,7 +380,9 @@ void TokenInfo::identifierKind(const Cursor &cursor, Recursion recursion) if (cursor.isInvalidDeclaration()) return; - if (recursion == Recursion::FirstPass && cursor.kind() != CXCursor_NotImplemented) { + if (recursion == Recursion::FirstPass + && cursor.kind() != CXCursor_NotImplemented + && cursor.kind() != CXCursor_PreprocessingDirective) { const Cursor c = realCursor(cursor); if (!clang_isInvalid(c.kind()) && c != cursor) { identifierKind(c, Recursion::FirstPass); diff --git a/tests/unit/unittest/data/highlightingmarks.cpp b/tests/unit/unittest/data/highlightingmarks.cpp index f4c9aa74bbb..79bca7d40d6 100644 --- a/tests/unit/unittest/data/highlightingmarks.cpp +++ b/tests/unit/unittest/data/highlightingmarks.cpp @@ -788,3 +788,7 @@ static inline constexpr vecn operator<(vecn a, vecn b) } return x; } + +struct foo { +#define blubb +}; diff --git a/tests/unit/unittest/tokenprocessor-test.cpp b/tests/unit/unittest/tokenprocessor-test.cpp index b7ebeba692e..b6acb918aba 100644 --- a/tests/unit/unittest/tokenprocessor-test.cpp +++ b/tests/unit/unittest/tokenprocessor-test.cpp @@ -1807,6 +1807,12 @@ TEST_F(TokenProcessor, OperatorInTemplate) ASSERT_THAT(infos[9], HasOnlyType(HighlightingType::Punctuation)); } +TEST_F(TokenProcessor, PreProcessorInStruct) +{ + const auto infos = translationUnit.tokenInfosInRange(sourceRange(793, 14)); + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor)); +} + Data *TokenProcessor::d; void TokenProcessor::SetUpTestCase() From 99cc306e0f61717299a34936f1778a6e92c02228 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Mon, 17 May 2021 08:56:39 +0200 Subject: [PATCH 04/15] qdoc: no need to use ssh here Change-Id: I09b1995cb1d029158a808afd54f4842ced4350f5 Reviewed-by: Leena Miettinen Reviewed-by: Tim Jenssen --- doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc index c91b97bd71c..7695af29e01 100644 --- a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc @@ -141,7 +141,7 @@ For example: \badcode - git clone "ssh://user@codereview.qt-project.org:29418/qt-labs/qtquickdesigner-components" + git clone "https://codereview.qt-project.org/qt-labs/qtquickdesigner-components" \endcode Then use qmake from your Qt installation to build the module and to add it @@ -166,7 +166,7 @@ For example: \badcode - git clone ssh://user@codereview.qt-project.org:29418/qt/qtquicktimeline + git clone "https://codereview.qt-project.org/qt/qtquicktimeline" \endcode Then build the module and add it to your Qt as described in the previous From c79a4fab6e6ce66fa7ca3fe128668a7393ea39dd Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 12 May 2021 17:25:24 +0200 Subject: [PATCH 05/15] Revert "ProjectExplorer: Remove ClangClToolChain::m_clangPath" This reverts commit 7a2e49435cc098dfc2a037d42d90a8743b7b51d9 as it broke handling clang-cl toolchains on Windows. Fixes: QTCREATORBUG-25690 Fixes: QTCREATORBUG-25693 Fixes: QTCREATORBUG-25698 Change-Id: Idfc7bc86ad8dd97f645908d4fe9530c760085347 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/msvctoolchain.cpp | 61 +++++++++++++++---- src/plugins/projectexplorer/msvctoolchain.h | 10 +++ src/plugins/projectexplorer/toolchain.h | 2 +- 3 files changed, 60 insertions(+), 13 deletions(-) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index bd1087a84c6..c57cf0e1d65 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1471,9 +1471,9 @@ void ClangClToolChainConfigWidget::setFromClangClToolChain() const auto *clangClToolChain = static_cast(toolChain()); if (clangClToolChain->isAutoDetected()) - m_llvmDirLabel->setText(clangClToolChain->compilerCommand().toUserOutput()); + m_llvmDirLabel->setText(QDir::toNativeSeparators(clangClToolChain->clangPath())); else - m_compilerCommand->setFilePath(clangClToolChain->compilerCommand()); + m_compilerCommand->setFilePath(Utils::FilePath::fromString(clangClToolChain->clangPath())); } static const MsvcToolChain *findMsvcToolChain(unsigned char wordWidth, Abi::OSFlavor flavor) @@ -1571,7 +1571,7 @@ static QList detectClangClToolChainInPath(const QString &clangClPat res << tc; } else { auto cltc = new ClangClToolChain; - cltc->setCompilerCommand(FilePath::fromString(clangClPath)); + cltc->setClangPath(clangClPath); cltc->setDisplayName(name); cltc->setDetection(ToolChain::AutoDetection); cltc->setLanguage(language); @@ -1589,18 +1589,18 @@ static QString compilerFromPath(const QString &path) void ClangClToolChainConfigWidget::applyImpl() { - FilePath compilerCommand = m_compilerCommand->filePath(); + Utils::FilePath clangClPath = m_compilerCommand->filePath(); auto clangClToolChain = static_cast(toolChain()); - clangClToolChain->setCompilerCommand(compilerCommand); + clangClToolChain->setClangPath(clangClPath.toString()); - if (compilerCommand.fileName() != "clang-cl.exe") { + if (clangClPath.fileName() != "clang-cl.exe") { clangClToolChain->resetVarsBat(); setFromClangClToolChain(); return; } const QString displayedVarsBat = m_varsBatDisplayCombo->currentText(); - QList results = detectClangClToolChainInPath(compilerCommand.toString(), + QList results = detectClangClToolChainInPath(clangClPath.toString(), {}, displayedVarsBat); @@ -1640,22 +1640,26 @@ ClangClToolChain::ClangClToolChain() { setDisplayName("clang-cl"); setTypeDisplayName(QCoreApplication::translate("ProjectExplorer::ClangToolChainFactory", "Clang")); - setCompilerCommandKey("ProjectExplorer.ClangClToolChain.LlvmDir"); } bool ClangClToolChain::isValid() const { - return MsvcToolChain::isValid() && compilerCommand().exists() - && compilerCommand().fileName() == "clang-cl.exe"; + const QFileInfo fi(clangPath()); + return MsvcToolChain::isValid() && fi.exists() && fi.fileName() == "clang-cl.exe"; } void ClangClToolChain::addToEnvironment(Utils::Environment &env) const { MsvcToolChain::addToEnvironment(env); - QDir path = compilerCommand().toFileInfo().absoluteDir(); // bin folder + QDir path = QFileInfo(m_clangPath).absoluteDir(); // bin folder env.prependOrSetPath(path.canonicalPath()); } +Utils::FilePath ClangClToolChain::compilerCommand() const +{ + return Utils::FilePath::fromString(m_clangPath); +} + QStringList ClangClToolChain::suggestedMkspecList() const { const QString mkspec = "win32-clang-" + Abi::toString(targetAbi().osFlavor()); @@ -1667,11 +1671,44 @@ QList ClangClToolChain::createOutputParsers() const return {new ClangClParser}; } +static inline QString llvmDirKey() +{ + return QStringLiteral("ProjectExplorer.ClangClToolChain.LlvmDir"); +} + +QVariantMap ClangClToolChain::toMap() const +{ + QVariantMap result = MsvcToolChain::toMap(); + result.insert(llvmDirKey(), m_clangPath); + return result; +} + +bool ClangClToolChain::fromMap(const QVariantMap &data) +{ + if (!MsvcToolChain::fromMap(data)) + return false; + const QString clangPath = data.value(llvmDirKey()).toString(); + if (clangPath.isEmpty()) + return false; + m_clangPath = clangPath; + + return true; +} + std::unique_ptr ClangClToolChain::createConfigurationWidget() { return std::make_unique(this); } +bool ClangClToolChain::operator==(const ToolChain &other) const +{ + if (!MsvcToolChain::operator==(other)) + return false; + + const auto *clangClTc = static_cast(&other); + return m_clangPath == clangClTc->m_clangPath; +} + Macros ClangClToolChain::msvcPredefinedMacros(const QStringList &cxxflags, const Utils::Environment &env) const { @@ -1685,7 +1722,7 @@ Macros ClangClToolChain::msvcPredefinedMacros(const QStringList &cxxflags, QStringList arguments = cxxflags; arguments.append(gccPredefinedMacrosOptions(language())); arguments.append("-"); - Utils::SynchronousProcessResponse response = cpp.runBlocking({compilerCommand(), arguments}); + Utils::SynchronousProcessResponse response = cpp.runBlocking({clangPath(), arguments}); if (response.result != Utils::SynchronousProcessResponse::Finished || response.exitCode != 0) { // Show the warning but still parse the output. QTC_CHECK(false && "clang-cl exited with non-zero code."); diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index f81566a0fc5..339ebb50aea 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -164,18 +164,28 @@ public: bool isValid() const override; QStringList suggestedMkspecList() const override; void addToEnvironment(Utils::Environment &env) const override; + Utils::FilePath compilerCommand() const override; // FIXME: Remove QList createOutputParsers() const override; + QVariantMap toMap() const override; + bool fromMap(const QVariantMap &data) override; std::unique_ptr createConfigurationWidget() override; BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( const Utils::Environment &env) const override; const QList &msvcToolchains() const; + QString clangPath() const { return m_clangPath; } + void setClangPath(const QString &path) { m_clangPath = path; } Macros msvcPredefinedMacros(const QStringList &cxxflags, const Utils::Environment &env) const override; Utils::LanguageVersion msvcLanguageVersion(const QStringList &cxxflags, const Utils::Id &language, const Macros ¯os) const override; + + bool operator==(const ToolChain &) const override; + +private: + QString m_clangPath; }; // -------------------------------------------------------------------------- diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 6c85293433b..1a05ec326c1 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -145,7 +145,7 @@ public: Utils::Id language() const; - Utils::FilePath compilerCommand() const; + virtual Utils::FilePath compilerCommand() const; // FIXME: De-virtualize. void setCompilerCommand(const Utils::FilePath &command); virtual QList createOutputParsers() const = 0; From 32653e1a7b1e1f5266069aecc5fa9952508f8020 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 12 May 2021 12:04:13 +0200 Subject: [PATCH 06/15] CppTools: Fix possible crash when testing Change-Id: I9ade8c861c44329376c8f1dcc9506561b7689de5 Reviewed-by: Christian Stenger --- src/plugins/cpptools/cpptoolstestcase.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/cpptools/cpptoolstestcase.cpp b/src/plugins/cpptools/cpptoolstestcase.cpp index 817c78993c1..d72101d8029 100644 --- a/src/plugins/cpptools/cpptoolstestcase.cpp +++ b/src/plugins/cpptools/cpptoolstestcase.cpp @@ -234,8 +234,9 @@ bool TestCase::waitUntilProjectIsFullyOpened(Project *project, int timeOutInMs) return QTest::qWaitFor( [project]() { - return !SessionManager::startupBuildSystem()->isParsing() - && CppModelManager::instance()->projectInfo(project).isValid(); + return SessionManager::startupBuildSystem() + && !SessionManager::startupBuildSystem()->isParsing() + && CppModelManager::instance()->projectInfo(project).isValid(); }, timeOutInMs); } From 06fd91634848c499a9628b6c91f5f03f817bde8d Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 May 2021 13:45:01 +0200 Subject: [PATCH 07/15] Do not show pane if external tool output is ignored Fixes: QTCREATORBUG-25728 Change-Id: I85650abb0227bdabe014ba324c1b3a3f35de4916 Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/externaltool.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp index 5e167bc2d06..6170334a216 100644 --- a/src/plugins/coreplugin/externaltool.cpp +++ b/src/plugins/coreplugin/externaltool.cpp @@ -666,7 +666,10 @@ void ExternalToolRunner::run() const CommandLine cmd{m_resolvedExecutable, m_resolvedArguments, CommandLine::Raw}; m_process->setCommand(cmd); m_process->setEnvironment(m_resolvedEnvironment); - MessageManager::writeDisrupting(tr("Starting external tool \"%1\"").arg(cmd.toUserOutput())); + const auto write = m_tool->outputHandling() == ExternalTool::ShowInPane + ? [](const QString &m) { MessageManager::writeDisrupting(m); } + : [](const QString &m) { MessageManager::writeSilently(m); }; + write(tr("Starting external tool \"%1\"").arg(cmd.toUserOutput())); m_process->start(); } @@ -686,7 +689,10 @@ void ExternalToolRunner::finished(int exitCode, QProcess::ExitStatus status) } if (m_tool->modifiesCurrentDocument()) DocumentManager::unexpectFileChange(m_expectedFileName); - MessageManager::writeFlashing(tr("\"%1\" finished").arg(m_resolvedExecutable.toUserOutput())); + const auto write = m_tool->outputHandling() == ExternalTool::ShowInPane + ? [](const QString &m) { MessageManager::writeFlashing(m); } + : [](const QString &m) { MessageManager::writeSilently(m); }; + write(tr("\"%1\" finished").arg(m_resolvedExecutable.toUserOutput())); deleteLater(); } From 5bf162a26ffd29a147e00932f71d19b30537bdfd Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Mon, 17 May 2021 08:58:01 +0200 Subject: [PATCH 08/15] qmldesigner: add PLUGIN_RECOMMENDS QmlPreview QmlPreview should be initiliazed before qmldesigner Change-Id: I43f093e9af0728068e939a95a40c9405ff585283 Reviewed-by: Qt CI Bot Reviewed-by: Eike Ziller --- src/plugins/qmldesigner/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 2b26ad383f3..e79c69ea6c3 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -16,6 +16,7 @@ add_qtc_plugin(QmlDesigner PLUGIN_DEPENDS Core ProjectExplorer QmlJSEditor QmakeProjectManager QmlProjectManager QtSupport TextEditor + PLUGIN_RECOMMENDS QmlPreview SOURCES designersettings.cpp designersettings.h designmodecontext.cpp designmodecontext.h From b3ad100016cf5801e22cdddfb240a6aa92e5f7f3 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 18 May 2021 06:31:54 +0200 Subject: [PATCH 09/15] Core: Fix build on Windows Amends 06fd91634848c499a9628b6c91f5f03f817bde8d. Change-Id: I143cc60d3f7b0a6ba16c2e341e4cd170b54914de Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/externaltool.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp index 6170334a216..2a8391f703b 100644 --- a/src/plugins/coreplugin/externaltool.cpp +++ b/src/plugins/coreplugin/externaltool.cpp @@ -667,8 +667,8 @@ void ExternalToolRunner::run() m_process->setCommand(cmd); m_process->setEnvironment(m_resolvedEnvironment); const auto write = m_tool->outputHandling() == ExternalTool::ShowInPane - ? [](const QString &m) { MessageManager::writeDisrupting(m); } - : [](const QString &m) { MessageManager::writeSilently(m); }; + ? QOverload::of(MessageManager::writeDisrupting) + : QOverload::of(MessageManager::writeSilently); write(tr("Starting external tool \"%1\"").arg(cmd.toUserOutput())); m_process->start(); } @@ -690,8 +690,8 @@ void ExternalToolRunner::finished(int exitCode, QProcess::ExitStatus status) if (m_tool->modifiesCurrentDocument()) DocumentManager::unexpectFileChange(m_expectedFileName); const auto write = m_tool->outputHandling() == ExternalTool::ShowInPane - ? [](const QString &m) { MessageManager::writeFlashing(m); } - : [](const QString &m) { MessageManager::writeSilently(m); }; + ? QOverload::of(MessageManager::writeFlashing) + : QOverload::of(MessageManager::writeSilently); write(tr("\"%1\" finished").arg(m_resolvedExecutable.toUserOutput())); deleteLater(); } From b87c3cc03e35ff57aeeaf150fba64f2097c28b30 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 12 May 2021 15:55:30 +0200 Subject: [PATCH 10/15] Fix Qt Creator plugin wizard's GitHub action for the changed location of build_plugin.py Fixes: QTCREATORBUG-25727 Change-Id: I6bda26b1820b86ac4cf12a55821eed879ee818bc Reviewed-by: Cristian Adam --- .../qtcreatorplugin/github_workflows_build_cmake.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml b/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml index bd5571b1d06..18ba6416392 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml @@ -212,10 +212,18 @@ jobs: set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ") + set(build_plugin_py "scripts/build_plugin.py") + foreach(dir "share/qtcreator/scripts" "Qt Creator.app/Contents/Resources/scripts" "Contents/Resources/scripts") + if(EXISTS "${{ steps.qt_creator.outputs.qtc_dir }}/${dir}/build_plugin.py") + set(build_plugin_py "${dir}/build_plugin.py") + break() + endif() + endforeach() + execute_process( COMMAND python -u - ${{ steps.qt_creator.outputs.qtc_dir }}/scripts/build_plugin.py + "${{ steps.qt_creator.outputs.qtc_dir }}/${build_plugin_py}" --name "$ENV{PLUGIN_NAME}-$ENV{QT_CREATOR_VERSION}-${{ matrix.config.artifact }}" --src . --build build From 2e24d4b0cc5f0e3763ce9609544ecca1d477d31b Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 18 May 2021 09:17:18 +0200 Subject: [PATCH 11/15] Wizards: Fix generation of dynamically populated models This was implemented for QAbstractItemModel based classes, but forgotten for QAbstractListModel and QAbstractTableModel based classes. Change-Id: I807f445e48d2906580abd0a65bb794d6e766c1a7 Reviewed-by: Eike Ziller --- .../wizards/classes/itemmodel/listmodel.cpp | 18 ++++++++++++++++++ .../wizards/classes/itemmodel/listmodel.h | 8 ++++++++ .../wizards/classes/itemmodel/tablemodel.cpp | 18 ++++++++++++++++++ .../wizards/classes/itemmodel/tablemodel.h | 8 ++++++++ 4 files changed, 52 insertions(+) diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp index b6c9c4b430d..921267d015d 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp @@ -35,6 +35,24 @@ int %{CN}::rowCount(const QModelIndex &parent) const // FIXME: Implement me! } +@if %{DynamicFetch} + +bool %{CN}::hasChildren(const QModelIndex &parent) const +{ + // FIXME: Implement me! +} + +bool %{CN}::canFetchMore(const QModelIndex &parent) const +{ + // FIXME: Implement me! + return false; +} + +void %{CN}::fetchMore(const QModelIndex &parent) +{ + // FIXME: Implement me! +} +@endif QVariant %{CN}::data(const QModelIndex &index, int role) const { diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h index 87812bdb595..fe1ef78cc61 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h @@ -28,6 +28,14 @@ public: // Basic functionality: int rowCount(const QModelIndex &parent = QModelIndex()) const override; +@if %{DynamicFetch} + // Fetch data dynamically: + bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; + + bool canFetchMore(const QModelIndex &parent) const override; + void fetchMore(const QModelIndex &parent) override; + +@endif QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; @if %{Editable} diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp index cda910e6f76..e8c71f18bb9 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp @@ -42,6 +42,24 @@ int %{CN}::columnCount(const QModelIndex &parent) const // FIXME: Implement me! } +@if %{DynamicFetch} + +bool %{CN}::hasChildren(const QModelIndex &parent) const +{ + // FIXME: Implement me! +} + +bool %{CN}::canFetchMore(const QModelIndex &parent) const +{ + // FIXME: Implement me! + return false; +} + +void %{CN}::fetchMore(const QModelIndex &parent) +{ + // FIXME: Implement me! +} +@endif QVariant %{CN}::data(const QModelIndex &index, int role) const { diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h index f6a0ad59c2f..b6293563064 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h @@ -29,6 +29,14 @@ public: int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; +@if %{DynamicFetch} + // Fetch data dynamically: + bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; + + bool canFetchMore(const QModelIndex &parent) const override; + void fetchMore(const QModelIndex &parent) override; + +@endif QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; @if %{Editable} From 712c1b9fb62ce75038b2c991f6a12fad65c59d6a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 May 2021 10:48:30 +0200 Subject: [PATCH 12/15] COIN: Do not zip results Not needed for pre-checks and takes a considerable amount of time. Change-Id: I2ab7d51bd75cfbafd5f7dd696f73740b9be035bb Reviewed-by: Qt CI Bot Reviewed-by: Cristian Adam --- coin/instructions/make_instructions.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/coin/instructions/make_instructions.yaml b/coin/instructions/make_instructions.yaml index 1c517ce7323..dec630f24fa 100644 --- a/coin/instructions/make_instructions.yaml +++ b/coin/instructions/make_instructions.yaml @@ -23,7 +23,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --with-tests --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." @@ -50,7 +50,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh --with-tests --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." @@ -92,7 +92,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --python-path {{.AgentWorkingDir}}\\build\\qt_temp\\python --elfutils-path {{.AgentWorkingDir}}\\buid\\qt_temp\\elfutils --llvm-path {{.AgentWorkingDir}}\\build\\qt_temp\\libclang --with-tests --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache --add-config=-DWITH_SCCACHE_SUPPORT=ON" + command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --python-path {{.AgentWorkingDir}}\\build\\qt_temp\\python --elfutils-path {{.AgentWorkingDir}}\\buid\\qt_temp\\elfutils --llvm-path {{.AgentWorkingDir}}\\build\\qt_temp\\libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache --add-config=-DWITH_SCCACHE_SUPPORT=ON" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." @@ -124,7 +124,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract python package, check logs." - type: ExecuteCommand - command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --python-path {{.AgentWorkingDir}}\\buid\\qt_temp\\python --no-qtcreator" + command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --python-path {{.AgentWorkingDir}}\\buid\\qt_temp\\python --no-qtcreator --no-zip" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." From 5b828f84fb961888d8ded3bc8e41844f45a99f70 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 May 2021 10:51:58 +0200 Subject: [PATCH 13/15] COIN: Turn off python output buffering for all platforms Was missing for some. Change-Id: I53aad1dbe352ed62c0c41376771c961aeca960e9 Reviewed-by: Qt CI Bot Reviewed-by: Cristian Adam --- coin/instructions/make_instructions.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coin/instructions/make_instructions.yaml b/coin/instructions/make_instructions.yaml index dec630f24fa..bee20f2527d 100644 --- a/coin/instructions/make_instructions.yaml +++ b/coin/instructions/make_instructions.yaml @@ -23,7 +23,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + command: "python -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." @@ -50,7 +50,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + command: "python -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." From 2c2a3a9bef9652a6de7213ca88a7c3de72f20e2b Mon Sep 17 00:00:00 2001 From: Mikhail Khachayants Date: Mon, 17 May 2021 13:31:41 +0300 Subject: [PATCH 14/15] Utils: Fix crash on showing tooltips when screen configuration changed Check QGuiApplication::screenAt(QPoint) return value. TextTip will use QGuiApplication::primaryScreen() if it's nullptr. Fixes: QTCREATORBUG-25747 Change-Id: If02648966e24f96f8c9a92e91b2bd27c1efc5f9e Reviewed-by: Eike Ziller --- src/libs/utils/tooltip/tips.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/tooltip/tips.cpp b/src/libs/utils/tooltip/tips.cpp index cab6bad63c0..2a1f4f8093f 100644 --- a/src/libs/utils/tooltip/tips.cpp +++ b/src/libs/utils/tooltip/tips.cpp @@ -206,7 +206,12 @@ void TextTip::configure(const QPoint &pos) // Try to find a nice width without unnecessary wrapping. setWordWrap(false); int tipWidth = sizeHint().width(); - const int screenWidth = QGuiApplication::screenAt(pos)->availableGeometry().width(); + + QScreen *screen = QGuiApplication::screenAt(pos); + if (!screen) + screen = QGuiApplication::primaryScreen(); + + const int screenWidth = screen->availableGeometry().width(); const int maxDesiredWidth = int(screenWidth * .5); if (tipWidth > maxDesiredWidth) { setWordWrap(true); From 801dbdf9324a67462eb6756f4ea49b31ae2074bb Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 May 2021 14:32:26 +0200 Subject: [PATCH 15/15] Android/Qbs: Improve startup time At startup the Android plugin looks at the NDK(s) for tool chains, and the for matching tool chains already registered in Qt Creator. If it finds one, it doesn't register a new one, but simply force-marks the found one as auto-detected. (See AndroidToolChainFactory::autodetectToolChainsFromNdks) Unfortunately changing the auto-detected property of a tool chain triggers a full update down the line, which for example Qbs takes as a hint to re-create profiles. This simply doesn't make sense. Setting the auto-detection flag shouldn't result in these updates. Task-number: QTCREATORBUG-25463 Change-Id: I22a5f6fbe08124a08041bf871e683bdbda279c01 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/toolchain.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 69355e44130..2427a2d4dd2 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -280,14 +280,7 @@ void ToolChain::toolChainUpdated() void ToolChain::setDetection(ToolChain::Detection de) { - if (d->m_detection == de) - return; - if (d->m_detection == ToolChain::UninitializedDetection) { - d->m_detection = de; - } else { - d->m_detection = de; - toolChainUpdated(); - } + d->m_detection = de; } QString ToolChain::typeDisplayName() const