From a1ca3888ba6acdce5da9c0de3cac81588f17a1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Thu, 25 Jul 2024 12:42:55 +0200 Subject: [PATCH 01/27] SquishTests: Retire Qt 5.4 on Linux We never used it on Mac and on Linux it doesn't provide any value. On Windows it's still the only kit using gcc, so it should not be removed without a replacement. Change-Id: I330f8d33a98759a762fd5cc97d5d55e03d1d03d6 Reviewed-by: Christian Stenger --- tests/system/README | 1 - tests/system/shared/classes.py | 4 ++-- tests/system/shared/project.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/system/README b/tests/system/README index 7dff67a84d0..d76526a6f73 100644 --- a/tests/system/README +++ b/tests/system/README @@ -18,7 +18,6 @@ Qt version for the respective toolchain with the components (if available): The exact versions and toolchains are: Linux: -Qt 5.4.1 (gcc) Qt 5.10.1 (gcc) Qt 5.14.1 (gcc) Qt 6.2.4 (gcc) diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index 3451da354ff..4659dda5535 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -25,7 +25,7 @@ class Targets: @staticmethod def availableTargetClasses(ignoreValidity=False): availableTargets = set(Targets.ALL_TARGETS) - if platform.system() == 'Darwin': + if platform.system() not in ('Windows', 'Microsoft'): availableTargets.remove(Targets.DESKTOP_5_4_1_GCC) return availableTargets @@ -84,7 +84,7 @@ class QtPath: def getPaths(pathSpec): qtTargets = [Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT, Targets.DESKTOP_6_2_4] - if platform.system() != 'Darwin': + if platform.system() in ('Windows', 'Microsoft'): qtTargets.append(Targets.DESKTOP_5_4_1_GCC) if pathSpec == QtPath.DOCS: return map(lambda target: QtPath.docsPath(target), qtTargets) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index cdf5290d895..b87920b4f76 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -533,7 +533,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False, ignoreVali result = result.union(set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT, Targets.DESKTOP_6_2_4])) - if platform.system() != 'Darwin': + if platform.system() in ('Windows', 'Microsoft'): result.add(Targets.DESKTOP_5_4_1_GCC) elif 'Platform independent' in text: result = Targets.desktopTargetClasses() From c1be9030000924a36cca9845e996bbc22ff76bdd Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 12 Aug 2024 10:13:43 +0200 Subject: [PATCH 02/27] ProjectExplorer: Fix Wizard button Fixes: QTCREATORBUG-31264 Change-Id: Ie884ce75596995ee150839cf1e42baffa8f22dbe Reviewed-by: Cristian Adam --- src/plugins/projectexplorer/projectwizardpage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index c71d762aaae..2b29f161b78 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -279,7 +279,8 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent) m_addToVersionControlComboBox = new QComboBox; m_addToVersionControlComboBox->setObjectName("addToVersionControlComboBox"); m_vcsManageButton = new QPushButton(ICore::msgShowOptionsDialog()); - m_vcsManageButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); + m_vcsManageButton + ->setSizePolicy(QSizePolicy::Maximum, m_vcsManageButton->sizePolicy().verticalPolicy()); m_filesLabel = new QLabel; m_filesLabel->setObjectName("filesLabel"); m_filesLabel->setAlignment(Qt::AlignBottom); From 782e7326e1fc819c896b7973c51f880c52b3a279 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 2 Aug 2024 06:15:52 +0200 Subject: [PATCH 03/27] Axivion: Use version name for display This is in line with other axivion plugins and the expected way of displaying versions. Change-Id: Idda8233a536a50b526d5927a5b5d2021aea3f3c5 Reviewed-by: Mohammad Mehdi Salem Naraghi Reviewed-by: hjk Reviewed-by: Jarek Kobus --- src/plugins/axivion/axivionoutputpane.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index be8655b5b2c..a5673502616 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -644,7 +644,7 @@ void IssuesWidget::updateBasicProjectInfo(const std::optional &versions = info->versions; for (auto it = versions.crbegin(); it != versions.crend(); ++it) { const Dto::AnalysisVersionDto &version = *it; - versionLabels.append(version.label.value_or(version.name)); + versionLabels.append(version.name); m_versionDates.append(version.date); } m_versionStart->addItems(versionLabels); From 310ec8d6a1dcdfad4ae5e75a582cd55ed1b6f9ee Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 12 Aug 2024 11:22:42 +0200 Subject: [PATCH 04/27] QMLJSEditor: Fix calling qmlformat on save Since the "format(...)" function would always create a temporary file first and then let qmlformat work on that it could not find a user supplied .qmlformat.ini in the project folder. To fix this we now create the temporary file next to the actual file. That way the qmlformat tool (and others) can find their config files in the tree hierarchy. Fixes: QTCREATORBUG-29668 Change-Id: I708efbd4bba014bc5743d901725b6fdaa06fefd8 Reviewed-by: David Schulz --- src/plugins/texteditor/formattexteditor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/formattexteditor.cpp b/src/plugins/texteditor/formattexteditor.cpp index 4bd358e3e39..b5496802982 100644 --- a/src/plugins/texteditor/formattexteditor.cpp +++ b/src/plugins/texteditor/formattexteditor.cpp @@ -62,8 +62,9 @@ static FormatOutput format(const FormatInput &input) switch (input.command.processing()) { case Command::FileProcessing: { // Save text to temporary file - Utils::TempFileSaver sourceFile(Utils::TemporaryDirectory::masterDirectoryPath() - + "/qtc_beautifier_XXXXXXXX." + input.filePath.suffix()); + Utils::TempFileSaver sourceFile( + input.filePath.parentDir() + / (input.filePath.fileName() + "_format_XXXXXXXX." + input.filePath.suffix())); sourceFile.setAutoRemove(true); sourceFile.write(input.sourceData.toUtf8()); if (!sourceFile.finalize()) { From e5aae2a781fd558c1f928d70cfbb2b38f65464b6 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 3 Jul 2024 14:22:52 +0200 Subject: [PATCH 05/27] ClangFormat: config use read only editors instead of disabled ones Change-Id: I709dd2421b25f21cffa9d94259507f1852f9ccec Reviewed-by: Artem Sokolovskii --- .../clangformat/clangformatconfigwidget.cpp | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index 418769cbf12..61b98281548 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -92,7 +92,7 @@ private: void initPreview(TextEditor::ICodeStylePreferences *codeStyle); void initEditor(TextEditor::ICodeStylePreferences *codeStyle); - void reopenClangFormatDocument(); + void reopenClangFormatDocument(bool readOnly); void updatePreview(); void slotCodeStyleChanged(TextEditor::ICodeStylePreferences *currentPreferences); @@ -120,9 +120,13 @@ bool ClangFormatConfigWidget::eventFilter(QObject *object, QEvent *event) return QWidget::eventFilter(object, event); } -ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferences *codeStyle, - Project *project, - QWidget *parent) +static bool isReadOnlyCodeStyle(TextEditor::ICodeStylePreferences *style) +{ + return style->isReadOnly() || style->isTemporarilyReadOnly() || !style->isAdditionalTabVisible(); +} + +ClangFormatConfigWidget::ClangFormatConfigWidget( + TextEditor::ICodeStylePreferences *codeStyle, Project *project, QWidget *parent) : CodeStyleEditorWidget(parent) { m_project = project; @@ -152,7 +156,7 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc slotCodeStyleChanged(codeStyle->currentPreferences()); - reopenClangFormatDocument(); + reopenClangFormatDocument(isReadOnlyCodeStyle(codeStyle)); updatePreview(); } @@ -163,10 +167,7 @@ void ClangFormatConfigWidget::slotCodeStyleChanged(TextEditor::ICodeStylePrefere m_config.reset(new ClangFormatFile(codeStyle)); m_config->setIsReadOnly(codeStyle->isReadOnly()); - m_editorWidget->setEnabled(!codeStyle->isReadOnly() && !codeStyle->isTemporarilyReadOnly() - && codeStyle->isAdditionalTabVisible()); - - reopenClangFormatDocument(); + reopenClangFormatDocument(isReadOnlyCodeStyle(codeStyle)); updatePreview(); } @@ -188,8 +189,6 @@ void ClangFormatConfigWidget::initEditor(TextEditor::ICodeStylePreferences *code Q_ARG(Core::IEditor *, m_editor.get())); m_editorWidget = m_editor->widget(); - m_editorWidget->setEnabled(!codeStyle->isReadOnly() && !codeStyle->isTemporarilyReadOnly() - && codeStyle->isAdditionalTabVisible()); m_editorScrollArea->setWidget(m_editor->widget()); m_editorScrollArea->setWidgetResizable(true); @@ -309,7 +308,7 @@ void ClangFormatConfigWidget::updatePreview() m_preview->textDocument()->autoFormatOrIndent(cursor); } -void ClangFormatConfigWidget::reopenClangFormatDocument() +void ClangFormatConfigWidget::reopenClangFormatDocument(bool readOnly) { GuardLocker locker(m_ignoreChanges); @@ -319,6 +318,10 @@ void ClangFormatConfigWidget::reopenClangFormatDocument() invokeMethodForLanguageClientManager("documentOpened", Q_ARG(Core::IDocument *, m_editor->document())); } + + auto textEditorWidget = qobject_cast(m_editorWidget); + QTC_ASSERT(textEditorWidget, m_editorWidget->setEnabled(!readOnly); return;); + textEditorWidget->setReadOnly(readOnly); } void ClangFormatConfigWidget::apply() From c0573a20474c4c090a16bb91baa283c6cfc9d6c3 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 15 Aug 2024 08:12:23 +0200 Subject: [PATCH 06/27] LanguageClient: Fix Diagnostics Line number Position::line is zero based, but Task::line is one-based. Change-Id: Ic4d8e5bdeb29721dbc289821ee928ee672378eb3 Reviewed-by: David Schulz --- src/plugins/languageclient/diagnosticmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/languageclient/diagnosticmanager.cpp b/src/plugins/languageclient/diagnosticmanager.cpp index 7fc4efb6ddc..db63b5a3f96 100644 --- a/src/plugins/languageclient/diagnosticmanager.cpp +++ b/src/plugins/languageclient/diagnosticmanager.cpp @@ -227,7 +227,7 @@ std::optional DiagnosticManager::createTask( return Task(taskType, taskText(diagnostic), doc->filePath(), - diagnostic.range().start().line(), + diagnostic.range().start().line() + 1, d->m_taskCategory, icon, Task::NoOptions); From d0a06748a86fa1d393bc866cdc47e5c3a0555be5 Mon Sep 17 00:00:00 2001 From: Semih Yavuz Date: Wed, 14 Aug 2024 11:48:42 +0200 Subject: [PATCH 07/27] qmlls client: opt out semantic highlighting for QtC 14.x, take 2 When we restart language server, everything is reset including dynamically registered/unregistered methods but clients aren't destroyed. Therefore, we need to register dynamically registered entities in the Client::start() method rather than the constructor. Customize the start behavior of qmlls client by applying template pattern. Amends df2e55d92a78e2e571f714fb2fc25478da5e0525 Task-number: QTCREATORBUG-31148 Change-Id: Ib974500beb46cb79d972756efd0f6c7bbd7a87af Reviewed-by: Sami Shalayel Reviewed-by: David Schulz --- src/plugins/languageclient/client.cpp | 5 +++++ src/plugins/languageclient/client.h | 1 + src/plugins/qmljseditor/qmllsclient.cpp | 14 ++++++++++---- src/plugins/qmljseditor/qmllsclient.h | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 4c2fcf101f6..98cf59898de 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1683,6 +1683,11 @@ void Client::setLogTarget(LogTarget target) } void Client::start() +{ + startImpl(); +} + +void Client::startImpl() { d->m_shutdownTimer.stop(); LanguageClientManager::addClient(this); diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index 13e908b2d50..ec4c7c26854 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -224,6 +224,7 @@ protected: void handleMessage(const LanguageServerProtocol::JsonRpcMessage &message); virtual void handleDiagnostics(const LanguageServerProtocol::PublishDiagnosticsParams ¶ms); virtual DiagnosticManager *createDiagnosticManager(); + virtual void startImpl(); private: friend class ClientPrivate; diff --git a/src/plugins/qmljseditor/qmllsclient.cpp b/src/plugins/qmljseditor/qmllsclient.cpp index 9fe50a5af7e..087e58dc255 100644 --- a/src/plugins/qmljseditor/qmllsclient.cpp +++ b/src/plugins/qmljseditor/qmllsclient.cpp @@ -66,10 +66,6 @@ QmllsClient *QmllsClient::clientForQmlls(const FilePath &qmlls) QmllsClient::QmllsClient(StdIOClientInterface *interface) : Client(interface) { - LanguageServerProtocol::Unregistration unregister; - unregister.setMethod("textDocument/semanticTokens"); - unregister.setId({}); - dynamicCapabilities().unregisterCapability({unregister}); } QmllsClient::~QmllsClient() @@ -77,4 +73,14 @@ QmllsClient::~QmllsClient() qmllsClients().remove(qmllsClients().key(this)); } +void QmllsClient::startImpl() +{ + LanguageServerProtocol::Unregistration unregister; + unregister.setMethod("textDocument/semanticTokens"); + unregister.setId({}); + dynamicCapabilities().unregisterCapability({unregister}); + + Client::startImpl(); +} + } // namespace QmlJSEditor diff --git a/src/plugins/qmljseditor/qmllsclient.h b/src/plugins/qmljseditor/qmllsclient.h index 30c0170bf70..2010ea0dda0 100644 --- a/src/plugins/qmljseditor/qmllsclient.h +++ b/src/plugins/qmljseditor/qmllsclient.h @@ -19,6 +19,7 @@ public: explicit QmllsClient(LanguageClient::StdIOClientInterface *interface); ~QmllsClient(); + void startImpl() override; static QmllsClient *clientForQmlls(const Utils::FilePath &qmlls); }; From 5d8a8982a1bd139d2d01fd593b9e1ad177d5aa40 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 14 Aug 2024 19:00:27 +0200 Subject: [PATCH 08/27] CMakePM: Do not have special treatment for PATH in CMake Presets Fixes: QTCREATORBUG-31439 Change-Id: I23b6616adc8fd6bfddd0bbd536d6a15b23fa0996 Reviewed-by: Marcus Tillmanns --- .../cmakeprojectmanager/presetsmacros.cpp | 38 +++---------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/presetsmacros.cpp b/src/plugins/cmakeprojectmanager/presetsmacros.cpp index cfc161b417e..bf02da3cba9 100644 --- a/src/plugins/cmakeprojectmanager/presetsmacros.cpp +++ b/src/plugins/cmakeprojectmanager/presetsmacros.cpp @@ -130,6 +130,7 @@ template void expand(const PresetType &preset, Environment &env, const FilePath &sourceDirectory) { const Environment presetEnv = getEnvCombined(preset.environment, env); + const Environment parentEnv = env; presetEnv.forEachEntry([&](const QString &key, const QString &value_, bool enabled) { if (!enabled) return; @@ -139,34 +140,14 @@ void expand(const PresetType &preset, Environment &env, const FilePath &sourceDi return presetEnv.value(macroName); }); - enum Operation { set, appendOrSet, prependOrSet }; - Operation op = set; - if (key.compare("PATH", Qt::CaseInsensitive) == 0) { - op = appendOrSet; - const int index = value.indexOf("$penv{PATH}", 0, Qt::CaseInsensitive); - if (index != 0) - op = prependOrSet; - value.replace("$penv{PATH}", "", Qt::CaseInsensitive); - } - - value = expandMacroEnv("penv", value, [env](const QString ¯oName) { - return env.value(macroName); + value = expandMacroEnv("penv", value, [parentEnv](const QString ¯oName) { + return parentEnv.value(macroName); }); // Make sure to expand the CMake macros also for environment variables expandAllButEnv(preset, sourceDirectory, value); - switch (op) { - case set: - env.set(key, value); - break; - case appendOrSet: - env.appendOrSet(key, value); - break; - case prependOrSet: - env.prependOrSet(key, value); - break; - } + env.set(key, value); }); } @@ -185,15 +166,6 @@ void expand(const PresetType &preset, EnvironmentItems &envItems, const FilePath return QString("${%1}").arg(macroName); }); - auto operation = EnvironmentItem::Operation::SetEnabled; - if (key.compare("PATH", Qt::CaseInsensitive) == 0) { - operation = EnvironmentItem::Operation::Append; - const int index = value.indexOf("$penv{PATH}", 0, Qt::CaseInsensitive); - if (index != 0) - operation = EnvironmentItem::Operation::Prepend; - value.replace("$penv{PATH}", "", Qt::CaseInsensitive); - } - value = expandMacroEnv("penv", value, [](const QString ¯oName) { return QString("${%1}").arg(macroName); }); @@ -201,7 +173,7 @@ void expand(const PresetType &preset, EnvironmentItems &envItems, const FilePath // Make sure to expand the CMake macros also for environment variables expandAllButEnv(preset, sourceDirectory, value); - envItems.emplace_back(Utils::EnvironmentItem(key, value, operation)); + envItems.emplace_back(Utils::EnvironmentItem(key, value)); }); } From 84d0664e5c35c5be76596e845a25f3cdad914c9e Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 15 Aug 2024 11:37:57 +0200 Subject: [PATCH 09/27] CMakePM: Fix macro substitution recursion One could have a "PATH": "$env{PATH}" entry that would bring Qt Creator into infinite recursion. Change-Id: If2402b8e8550dc5be2435f4ca040f91ec239a06c Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/presetsmacros.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/presetsmacros.cpp b/src/plugins/cmakeprojectmanager/presetsmacros.cpp index bf02da3cba9..159e16f4551 100644 --- a/src/plugins/cmakeprojectmanager/presetsmacros.cpp +++ b/src/plugins/cmakeprojectmanager/presetsmacros.cpp @@ -101,7 +101,9 @@ static QString expandMacroEnv(const QString ¯oPrefix, do { done = true; for (qsizetype pos = 0; int len = findMacro(result, &pos, ¯oName);) { - result.replace(pos, len, op(macroName)); + const QString replacement = op(macroName); + // Prevent recursion by not allowing the same value to be reused + result.replace(pos, len, replacement != value ? replacement : ""); pos += macroName.length(); done = false; } From d084b77e7e3809f124f3594118f338d36eac2e59 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 15 Aug 2024 12:07:00 +0200 Subject: [PATCH 10/27] CMakePM: Restrict CMake Presets macro evaluation for environment Only do the macro evaluation if the preset has an "environment" entry. Then only for the values present in the "environment" entry. This way we advert any accidental environment macro evaluation that would not be related to the preset. Change-Id: Iddbe24b32e0f1a80dd424e61e4c6b8317fe9bb58 Reviewed-by: Marcus Tillmanns --- .../cmakeprojectmanager/presetsmacros.cpp | 58 ++++++++++--------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/presetsmacros.cpp b/src/plugins/cmakeprojectmanager/presetsmacros.cpp index 159e16f4551..8177d877352 100644 --- a/src/plugins/cmakeprojectmanager/presetsmacros.cpp +++ b/src/plugins/cmakeprojectmanager/presetsmacros.cpp @@ -131,18 +131,20 @@ static Environment getEnvCombined(const std::optional &optPresetEnv template void expand(const PresetType &preset, Environment &env, const FilePath &sourceDirectory) { - const Environment presetEnv = getEnvCombined(preset.environment, env); + if (!preset.environment) + return; + + const Environment combinedEnv = getEnvCombined(preset.environment, env); const Environment parentEnv = env; - presetEnv.forEachEntry([&](const QString &key, const QString &value_, bool enabled) { + preset.environment->forEachEntry([&](const QString &key, QString value, bool enabled) { if (!enabled) return; - QString value = value_; expandAllButEnv(preset, sourceDirectory, value); - value = expandMacroEnv("env", value, [presetEnv](const QString ¯oName) { - return presetEnv.value(macroName); + value = expandMacroEnv("env", value, [&combinedEnv](const QString ¯oName) { + return combinedEnv.value(macroName); }); - value = expandMacroEnv("penv", value, [parentEnv](const QString ¯oName) { + value = expandMacroEnv("penv", value, [&parentEnv](const QString ¯oName) { return parentEnv.value(macroName); }); @@ -156,27 +158,31 @@ void expand(const PresetType &preset, Environment &env, const FilePath &sourceDi template void expand(const PresetType &preset, EnvironmentItems &envItems, const FilePath &sourceDirectory) { - const Environment presetEnv = preset.environment ? *preset.environment : Environment(); - presetEnv.forEachEntry([&](const QString &key, const QString &value_, bool enabled) { - if (!enabled) - return; - QString value = value_; - expandAllButEnv(preset, sourceDirectory, value); - value = expandMacroEnv("env", value, [presetEnv](const QString ¯oName) { - if (presetEnv.hasKey(macroName)) - return presetEnv.value(macroName); - return QString("${%1}").arg(macroName); + if (!preset.environment) + return; + + preset.environment->forEachEntry( + [&preset, + &sourceDirectory, + &envItems](const QString &key, QString value, bool enabled) { + if (!enabled) + return; + expandAllButEnv(preset, sourceDirectory, value); + value = expandMacroEnv("env", value, [&preset](const QString ¯oName) { + if (preset.environment->hasKey(macroName)) + return preset.environment->value(macroName); + return QString("${%1}").arg(macroName); + }); + + value = expandMacroEnv("penv", value, [](const QString ¯oName) { + return QString("${%1}").arg(macroName); + }); + + // Make sure to expand the CMake macros also for environment variables + expandAllButEnv(preset, sourceDirectory, value); + + envItems.emplace_back(Utils::EnvironmentItem(key, value)); }); - - value = expandMacroEnv("penv", value, [](const QString ¯oName) { - return QString("${%1}").arg(macroName); - }); - - // Make sure to expand the CMake macros also for environment variables - expandAllButEnv(preset, sourceDirectory, value); - - envItems.emplace_back(Utils::EnvironmentItem(key, value)); - }); } template From 449d2d931ba6d80f02b0842dfcc2b6181e1d00d0 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 15 Aug 2024 15:59:39 +0200 Subject: [PATCH 11/27] wininterrupt: Build for x86, x64 and arm64 at once When wininterrupt is opened standalone, then the build will build itself with MSBuild for x86, x64 and amr64 architectures. The architecture list can be specified with the WININTERRUPT_BUILD_ARCHS (arm64 win32 x64) CMake parameter. Task-number: QTCREATORBUG-31345 Change-Id: I97228c6fd650a3811451ac527d41e5eb7783044d Reviewed-by: David Schulz --- src/tools/wininterrupt/CMakeLists.txt | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/tools/wininterrupt/CMakeLists.txt b/src/tools/wininterrupt/CMakeLists.txt index fdd5a33e4d1..47977c86982 100644 --- a/src/tools/wininterrupt/CMakeLists.txt +++ b/src/tools/wininterrupt/CMakeLists.txt @@ -13,6 +13,49 @@ if (NOT QT_CREATOR_API_DEFINED) include(QtCreatorIDEBranding) include(QtCreatorAPI) qtc_handle_compiler_cache_support() + + # Compile for x86, x64 and arm64 + if (NOT ${PROJECT_NAME}-MultiBuild) + include(ExternalProject) + + set(generator "Visual Studio 16 2019") + if(CMAKE_CXX_COMPILER MATCHES "Microsoft Visual Studio/2022/") + set(generator "Visual Studio 17 2022") + endif() + + macro (setup_executable arch) + ExternalProject_Add(${arch}-bld + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" + CMAKE_GENERATOR "${generator}" + CMAKE_GENERATOR_PLATFORM "${arch}" + CMAKE_ARGS + -D${PROJECT_NAME}-MultiBuild=ON + BUILD_COMMAND + ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} + INSTALL_COMMAND + ${CMAKE_COMMAND} --install . --config ${CMAKE_BUILD_TYPE} + --prefix "${CMAKE_BINARY_DIR}" --component wininterrupt + ) + endmacro() + + if (NOT WININTERRUPT_BUILD_ARCHS) + set(WININTERRUPT_BUILD_ARCHS arm64 win32 x64) + endif() + foreach(arch IN LISTS WININTERRUPT_BUILD_ARCHS) + setup_executable(${arch}) + endforeach() + + list(LENGTH WININTERRUPT_BUILD_ARCHS build_archs_length) + if (build_archs_length GREATER 0) + install( + DIRECTORY "${CMAKE_BINARY_DIR}/bin" + DESTINATION . + COMPONENT wininterrupt + ) + endif() + + return() + endif() endif() if (NOT WIN32) From 602fcf7ace05a8d2f1e66386f68322efbfaace8d Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 21 Aug 2024 09:11:20 +0200 Subject: [PATCH 12/27] wininterrupt: fix MinGW build Amends 449d2d931ba6d80f02b0842dfcc2b6181e1d00d0 Change-Id: Ic43098c0e32b81daa4463609439650c0100cf8d8 Reviewed-by: David Schulz --- src/tools/wininterrupt/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/wininterrupt/CMakeLists.txt b/src/tools/wininterrupt/CMakeLists.txt index 47977c86982..e96cf6151b7 100644 --- a/src/tools/wininterrupt/CMakeLists.txt +++ b/src/tools/wininterrupt/CMakeLists.txt @@ -15,7 +15,7 @@ if (NOT QT_CREATOR_API_DEFINED) qtc_handle_compiler_cache_support() # Compile for x86, x64 and arm64 - if (NOT ${PROJECT_NAME}-MultiBuild) + if (NOT ${PROJECT_NAME}-MultiBuild AND NOT MINGW) include(ExternalProject) set(generator "Visual Studio 16 2019") From ff396f4fc5d7b529274395afcc33a78ce5c37704 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 15 Aug 2024 10:45:38 +0200 Subject: [PATCH 13/27] Qt Quick Application wizard: Remove QDS compatibility option Generation of a Qt Quick application with the "Create a project that you can open in QDS" option made use of QDS' original wizard templates. Since QDS dropped generation of the CMake project via the wizard, and the respective temple files were removed, this is not anymore possible. This change removes the option from the wizard. Task-number: QTCREATORBUG-31355 Change-Id: If0b9106e35c9fde708f7432106a9656a95543670 Reviewed-by: Knud Dollereder --- .../projects/qtquickapplication/wizard.json | 170 +----------------- 1 file changed, 6 insertions(+), 164 deletions(-) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json index a41ee12e516..866350f8ac0 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json @@ -3,7 +3,7 @@ "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject" ], "id": "U.QtQuickApplicationEmpty", "category": "D.ApplicationQt", - "trDescription": "Creates a Qt Quick application that can have both QML and C++ code. You can build the application and deploy it to desktop, embedded, and mobile target platforms.\n\nYou can select an option to create a project that you can open in Qt Design Studio, which has a visual editor for Qt Quick UIs.", + "trDescription": "Creates a Qt Quick application that can have both QML and C++ code. You can build the application and deploy it to desktop, embedded, and mobile target platforms.", "trDisplayName": "Qt Quick Application", "trDisplayCategory": "Application (Qt)", "icon": "icon.png", @@ -21,23 +21,7 @@ { "key": "HasFailureSignal", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.3' }"}, { "key": "UsesAutoResourcePrefix", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.4' }"}, { "key": "HasLoadFromModule", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.4' && value('UsesAutoResourcePrefix') }"}, - { "key": "FeatureQt", "value": "QtSupport.Wizards.FeatureQt.%{MinimumSupportedQtVersion}"}, - { "key": "QdsWizardPath", "value": "%{IDE:ResourcePath}/qmldesigner/studio_templates/projects" }, - { "key": "NoQdsProjectStyle", "value": "%{JS: !%{QdsProjectStyle} }" }, - - { "key": "ImportModuleName", "value": "%{ProjectName}" }, - { "key": "ImportModuleVersion", "value": "" }, - { "key": "IsQt6Project", "value": true }, - { "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" }, - { "key": "ProjectPluginName", "value": "%{ProjectName}plugin" }, - { "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" }, - { "key": "QtQuickControlsStyle", "value": "Material" }, - { "key": "QtQuickControlsStyleTheme", "value": "Light" }, - { "key": "QtQuickVersion", "value": "6.2" }, - { "key": "ScreenHeight", "value": 1080 }, - { "key": "ScreenWidth", "value": 1920 }, - { "key": "UIClassName", "value": "Screen01" }, - { "key": "UIClassFileName", "value": "%{JS: Util.fileName('%{UIClassName}', 'ui.qml')}" } + { "key": "FeatureQt", "value": "QtSupport.Wizards.FeatureQt.%{MinimumSupportedQtVersion}"} ], "pages": @@ -53,18 +37,6 @@ "typeId": "Fields", "data": [ - { - "name": "QdsProjectStyle", - "trDisplayName": "Creates a project that you can open in Qt Design Studio", - "trToolTip": "Creates a project with a structure that is compatible both with Qt Design Studio (via .qmlproject) and with Qt Creator (via CMakeLists.txt). It contains a .ui.qml form that you can visually edit in Qt Design Studio.", - "type": "CheckBox", - "span": true, - "persistenceKey": "QtQuick.QdsProjectStyle", - "data": - { - "checked": false - } - }, { "name": "UseVirtualKeyboard", "trDisplayName": "Use Qt Virtual Keyboard", @@ -116,151 +88,21 @@ [ { "source": "CMakeLists.txt", - "openAsProject": true, - "condition": "%{NoQdsProjectStyle}" + "openAsProject": true }, { "source": "main.cpp", - "target": "%{MainCppFileName}", - "condition": "%{NoQdsProjectStyle}" + "target": "%{MainCppFileName}" }, { "source": "Main.qml.tpl", "target": "Main.qml", - "openInEditor": true, - "condition": "%{NoQdsProjectStyle}" + "openInEditor": true }, { "source": "../git.ignore", "target": ".gitignore", - "condition": "%{JS: %{NoQdsProjectStyle} && !value('IsSubproject') && value('VersionControl') === 'G.Git' }" - } - ] - }, - { - "typeId": "File", - "data": - [ - { - "source": "%{QdsWizardPath}/common/app.qmlproject.tpl", - "target": "%{ProjectDirectory}/%{QmlProjectFileName}", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/CMakeLists.main.txt.tpl", - "target": "%{ProjectDirectory}/CMakeLists.txt", - "openAsProject": true, - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/qmlmodules.tpl", - "target": "%{ProjectDirectory}/qmlmodules", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/qmlcomponents.tpl", - "target": "%{ProjectDirectory}/qmlcomponents", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/insight.tpl", - "target": "%{ProjectDirectory}/insight", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/main.qml", - "target": "%{ProjectDirectory}/main.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/qtquickcontrols2.conf.tpl", - "target": "%{ProjectDirectory}/qtquickcontrols2.conf", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/main.cpp.tpl", - "target": "%{ProjectDirectory}/src/main.cpp", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/app_environment.h.tpl", - "target": "%{ProjectDirectory}/src/app_environment.h", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/import_qml_plugins.h.tpl", - "target": "%{ProjectDirectory}/src/import_qml_plugins.h", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/import_qml_components_plugins.h.tpl", - "target": "%{ProjectDirectory}/src/import_qml_components_plugins.h", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/CMakeLists.content.txt.tpl", - "target": "%{ProjectDirectory}/content/CMakeLists.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/App.qml.tpl", - "target": "%{ProjectDirectory}/content/App.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/application/Screen01.ui.qml.tpl", - "target": "%{ProjectDirectory}/content/Screen01.ui.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/fonts.txt", - "target": "%{ProjectDirectory}/content/fonts/fonts.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/asset_imports.txt", - "target": "%{ProjectDirectory}/asset_imports/asset_imports.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/CMakeLists.imports.txt.tpl", - "target": "%{ProjectDirectory}/imports/CMakeLists.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/CMakeLists.importmodule.txt.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/CMakeLists.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/importmodule.qmldir.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/qmldir", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/Constants.qml.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/Constants.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/DirectoryFontLoader.qml.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DirectoryFontLoader.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/EventListModel.qml.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/EventListModel.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/EventListSimulator.qml.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/EventListSimulator.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/designer/plugin.metainfo", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo", - "condition": "%{QdsProjectStyle}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git' }" } ] } From aa7ff1a5f201fb66768d3d87d217c2b8e1c93fdc Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 20 Aug 2024 10:50:14 +0200 Subject: [PATCH 14/27] QmlJSEditor: add qml snippets to qmlls provided completions Fixes: QTCREATORBUG-31322 Change-Id: I46cc57c621d04a8d05438778a65e6e2c50498355 Reviewed-by: Sami Shalayel Reviewed-by: Fabian Kosmale --- src/plugins/qmljseditor/qmllsclient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qmljseditor/qmllsclient.cpp b/src/plugins/qmljseditor/qmllsclient.cpp index 087e58dc255..0df665c0f03 100644 --- a/src/plugins/qmljseditor/qmllsclient.cpp +++ b/src/plugins/qmljseditor/qmllsclient.cpp @@ -3,6 +3,7 @@ #include "qmllsclient.h" +#include "qmljseditorconstants.h" #include "qmljseditortr.h" #include @@ -66,6 +67,7 @@ QmllsClient *QmllsClient::clientForQmlls(const FilePath &qmlls) QmllsClient::QmllsClient(StdIOClientInterface *interface) : Client(interface) { + setSnippetsGroup(QmlJSEditor::Constants::QML_SNIPPETS_GROUP_ID); } QmllsClient::~QmllsClient() From 4cbede6fd16791c7b7b657d318eea2defdae67ce Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 5 Aug 2024 18:09:24 +0200 Subject: [PATCH 15/27] qtcreatorcdbext: Build for x86, x64 and arm64 at once When the qtcreatorcdbext is opened standalone, then the build will build itself with MSBuild for x86, x64 and amr64 architectures. The architecture list can be specified with the QTCREATORCDBEXT_BUILD_ARCHS (arm64 win32 x64) CMake parameter. Task-number: QTCREATORBUG-31345 Change-Id: I6174e005d0664f444eacd8f7544edf49af5639e9 Reviewed-by: David Schulz --- src/libs/qtcreatorcdbext/CMakeLists.txt | 66 ++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/src/libs/qtcreatorcdbext/CMakeLists.txt b/src/libs/qtcreatorcdbext/CMakeLists.txt index 47eca2cd163..bdda6a1f78f 100644 --- a/src/libs/qtcreatorcdbext/CMakeLists.txt +++ b/src/libs/qtcreatorcdbext/CMakeLists.txt @@ -13,14 +13,55 @@ if (NOT QT_CREATOR_API_DEFINED) include(QtCreatorIDEBranding) include(QtCreatorAPI) qtc_handle_compiler_cache_support() + + # Compile for x86, x64 and arm64 + if (NOT ${PROJECT_NAME}-MultiBuild AND NOT MINGW) + include(ExternalProject) + + set(generator "Visual Studio 16 2019") + if(CMAKE_CXX_COMPILER MATCHES "Microsoft Visual Studio/2022/") + set(generator "Visual Studio 17 2022") + endif() + + macro (setup_library arch) + ExternalProject_Add(${arch}-bld + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" + CMAKE_GENERATOR "${generator}" + CMAKE_GENERATOR_PLATFORM "${arch}" + CMAKE_ARGS + -D${PROJECT_NAME}-MultiBuild=ON + BUILD_COMMAND + ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} + INSTALL_COMMAND + ${CMAKE_COMMAND} --install . --config ${CMAKE_BUILD_TYPE} + --prefix "${CMAKE_BINARY_DIR}" --component qtcreatorcdbext + ) + endmacro() + + if (NOT QTCREATORCDBEXT_BUILD_ARCHS) + set(QTCREATORCDBEXT_BUILD_ARCHS arm64 win32 x64) + endif() + foreach(arch IN LISTS QTCREATORCDBEXT_BUILD_ARCHS) + setup_library(${arch}) + endforeach() + + list(LENGTH QTCREATORCDBEXT_BUILD_ARCHS build_archs_length) + if (build_archs_length GREATER 0) + install( + DIRECTORY "${CMAKE_BINARY_DIR}/lib" + DESTINATION . + COMPONENT qtcreatorcdbext + ) + endif() + + return() + endif() endif() if (NOT WIN32 OR NOT MSVC) return() endif() -find_library(DbgEngLib dbgeng) - set(ArchSuffix "32") if (CMAKE_SIZEOF_VOID_P EQUAL 8) set(ArchSuffix "64") @@ -30,9 +71,13 @@ if (MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARM") set(ArchSuffix "arm${ArchSuffix}") endif() +if (NOT EXISTS "${CMAKE_BINARY_DIR}/lib/qtcreatorcdbext${ArchSuffix}") + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib/qtcreatorcdbext${ArchSuffix}") +endif() + add_qtc_library(qtcreatorcdbext SHARED COMPONENT qtcreatorcdbext - DEPENDS ${DbgEngLib} + DEPENDS dbgeng DESTINATION lib/qtcreatorcdbext${ArchSuffix}/ SOURCES common.cpp common.h @@ -95,18 +140,25 @@ if (_library_enabled) endif() # Support for cross-compilation for arm64 on a x64 system - if (MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARM" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^AMD") + if (NOT MSVC_CXX_ARCHITECTURE_ID STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) find_program(dumpbin_executable dumpbin) find_program(lib_executable lib) string(TOLOWER ${MSVC_CXX_ARCHITECTURE_ID} lower_arch_name) + if (lower_arch_name STREQUAL "arm64") + set(python_suffix "arm64") + elseif (lower_arch_name STREQUAL "x64") + set(python_suffix "amd64") + else() + set(python_suffix "win32") + endif() if (NOT dumpbin_executable OR NOT lib_executable) message(WARNING "Couldn't locate dumpbin.exe or lib.exe executables") return() endif() - if (Python3_VERSION VERSION_LESS "3.11.0") + if (Python3_VERSION VERSION_LESS "3.11.0" AND lower_arch_name STREQUAL "arm64") message(WARNING "Python 3.11.0 needs to be installed. This version is the first version that has arm64 Windows support") return() endif() @@ -129,7 +181,7 @@ if (_library_enabled) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PythonNameWithVersion}.def "${pythondef}") execute_process( - COMMAND ${lib_executable} + COMMAND "${lib_executable}" /def:${CMAKE_CURRENT_BINARY_DIR}/${PythonNameWithVersion}.def /out:${CMAKE_CURRENT_BINARY_DIR}/${PythonNameWithVersion}.lib /machine:${lower_arch_name} /nologo) set(Python3_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/${PythonNameWithVersion}.lib") @@ -139,7 +191,7 @@ if (_library_enabled) endif() if (NOT PythonTargetArchDll) - set(python_embed_url "https://www.python.org/ftp/python/${Python3_VERSION}/python-${Python3_VERSION}-embed-${lower_arch_name}.zip") + set(python_embed_url "https://www.python.org/ftp/python/${Python3_VERSION}/python-${Python3_VERSION}-embed-${python_suffix}.zip") message(STATUS "Downloading ${python_embed_url}") foreach(retry RANGE 10) From 2f320436d399d554510b666c2cdd0f030d2beffc Mon Sep 17 00:00:00 2001 From: Sami Shalayel Date: Tue, 20 Aug 2024 17:59:02 +0200 Subject: [PATCH 16/27] restart qmlls after a build Slightly related to QTCREATORBUG-24428 about resetting the codemodel after build so it can find the generated *.qmltypes from the buildfolder: Restart qmlls clients after builds to force qmlls to re-scan the build folder (and eventually find new qmldir, qmltypes, QML modules, etc generated by the CMake scripts during the build). Task-number: QTCREATORBUG-24428 Change-Id: I568401050586358ac085cf2c30236a5a0a91a944 Reviewed-by: Fabian Kosmale Reviewed-by: Semih Yavuz Reviewed-by: David Schulz --- src/plugins/qmljseditor/qmllsclient.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/qmljseditor/qmllsclient.cpp b/src/plugins/qmljseditor/qmllsclient.cpp index 0df665c0f03..ce72cf7977c 100644 --- a/src/plugins/qmljseditor/qmllsclient.cpp +++ b/src/plugins/qmljseditor/qmllsclient.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include #include @@ -68,6 +70,12 @@ QmllsClient::QmllsClient(StdIOClientInterface *interface) : Client(interface) { setSnippetsGroup(QmlJSEditor::Constants::QML_SNIPPETS_GROUP_ID); + + connect( + ProjectExplorer::BuildManager::instance(), + &ProjectExplorer::BuildManager::buildQueueFinished, + this, + [this]() { LanguageClientManager::restartClient(this); }); } QmllsClient::~QmllsClient() From 604dfa57efbf39a3edee7a205fb6692c01e5b50a Mon Sep 17 00:00:00 2001 From: Sami Shalayel Date: Tue, 20 Aug 2024 17:36:13 +0200 Subject: [PATCH 17/27] Reset qml code model after build Reset the code model after a build, so it can re-scan the build folder for changed .qmltypes files. This fixes the issue of the QtC embedded code model not recognizing modules and .qmltypes files after a build on qmake projects. Fixes: QTCREATORBUG-24428 Change-Id: I1e584addd2fe9b0918a8fd9b372b4fa23b72f36b Reviewed-by: Fabian Kosmale Reviewed-by: Semih Yavuz Reviewed-by: Christian Kandeler --- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index c118ba1920e..53e80f482b2 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -745,8 +745,10 @@ void QmakeBuildSystem::asyncUpdate() void QmakeBuildSystem::buildFinished(bool success) { - if (success) + if (success) { m_invalidateQmakeVfsContents = true; + updateQmlJSCodeModel(); + } } Tasks QmakeProject::projectIssues(const Kit *k) const From 6ea2ab3ab761f846d8ad03a2a6c51226c41b284d Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 22 Aug 2024 17:45:13 +0200 Subject: [PATCH 18/27] Android: Compile app profiles before starting debugging At https://source.android.com/docs/core/runtime/configure/art-service we learn that: "Starting with Android 14, on-device AOT compilation for apps (a.k.a. dexopt) is handled by ART Service. ART Service is a part of the ART module, and you can customize it through system properties and APIs." This commit makes sure to have the app profiles created before the application was started. Otherwise the service will do it in the background and could trigger exceptions that would land in disassembly. Fixes: QTCREATORBUG-29928 Change-Id: I5d30fa03535f03b15d5470789323c0af0246d0dd Reviewed-by: Alessandro Portale Reviewed-by: Assam Boudjelthia Reviewed-by: Jarek Kobus --- src/plugins/android/androidrunnerworker.cpp | 7 +++++++ src/plugins/android/androidrunnerworker.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index a764167f365..335103f3ba7 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -288,6 +288,12 @@ bool AndroidRunnerWorker::packageFileExists(const QString &filePath) return success && !output.trimmed().isEmpty(); } +void AndroidRunnerWorker::compileAppProfiles() +{ + runAdb({"shell", "pm", "art", "clear-app-profiles", m_packageName}); + runAdb({"shell", "pm", "compile", "-m", "verify", "-f", m_packageName}); +} + QStringList AndroidRunnerWorker::selector() const { return AndroidDeviceInfo::adbSelector(m_deviceSerialNumber); @@ -808,6 +814,7 @@ void AndroidRunnerWorker::onProcessIdChanged(const PidUserPair &pidUser) for (const QString &entry: std::as_const(m_afterFinishAdbCommands)) runAdb(entry.split(' ', Qt::SkipEmptyParts)); } else { + compileAppProfiles(); if (m_useCppDebugger) startNativeDebugging(); // In debugging cases this will be funneled to the engine to actually start diff --git a/src/plugins/android/androidrunnerworker.h b/src/plugins/android/androidrunnerworker.h index bba8d351041..6b9ae2dae6a 100644 --- a/src/plugins/android/androidrunnerworker.h +++ b/src/plugins/android/androidrunnerworker.h @@ -66,6 +66,7 @@ private: bool startDebuggerServer(const QString &packageDir, const QString &debugServerFile, QString *errorStr = nullptr); bool deviceFileExists(const QString &filePath); bool packageFileExists(const QString& filePath); + void compileAppProfiles(); bool uploadDebugServer(const QString &debugServerFileName); void asyncStartLogcat(); From 2568988dab15402668351f69c9bf0067b53937f7 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 23 Aug 2024 12:41:38 +0200 Subject: [PATCH 19/27] qtcreatorcdbext: Improve cross-compilation check It was failing on x64 since the values are x64 and AMD64 and were failing the check. Arm has both values ARM64. Change-Id: I404b85d9c499464797ece912ee5b83f93c21d04d Reviewed-by: David Schulz --- src/libs/qtcreatorcdbext/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libs/qtcreatorcdbext/CMakeLists.txt b/src/libs/qtcreatorcdbext/CMakeLists.txt index bdda6a1f78f..b1d77c6c218 100644 --- a/src/libs/qtcreatorcdbext/CMakeLists.txt +++ b/src/libs/qtcreatorcdbext/CMakeLists.txt @@ -140,7 +140,14 @@ if (_library_enabled) endif() # Support for cross-compilation for arm64 on a x64 system - if (NOT MSVC_CXX_ARCHITECTURE_ID STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) + if (MSVC_CXX_ARCHITECTURE_ID STREQUAL "ARM64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(arm64_on_arm64 ON) + endif() + if (MSVC_CXX_ARCHITECTURE_ID STREQUAL "x64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64") + set(x64_on_x64 ON) + endif() + + if (NOT arm64_on_arm64 AND NOT x64_on_x64) find_program(dumpbin_executable dumpbin) find_program(lib_executable lib) From 1ce292734d30bc4a3bb73dc39e8bf5a524ab4144 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 23 Aug 2024 10:22:35 +0200 Subject: [PATCH 20/27] Update qbs submodule to HEAD of 2.4 branch Change-Id: I93229407e93bac586f4cb143c41a76df3b00f6b3 Reviewed-by: Ivan Komissarov --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 34e91f7a5d8..64e82d38558 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 34e91f7a5d825c9462d59e2283be628b9d5b5817 +Subproject commit 64e82d38558dccc0ddfb1bdcefe11d13a43fafaf From cd198388b7f7f0834492070e73b111116e660653 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 16 Jul 2024 14:35:56 +0200 Subject: [PATCH 21/27] Doc: Hide SDK Tool docs from QDS Manual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I36160ed1e1d7c360df97dcce20020933848d4d8f Reviewed-by: Teea Põldsam Reviewed-by: Mats Honkamaa --- doc/qtdesignstudio/config/qtdesignstudio.qdocconf | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf index 95d1475cf15..baca9a8654e 100644 --- a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf +++ b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf @@ -55,6 +55,7 @@ excludedirs += ../../qtcreator/examples/accelbubble \ ../../qtcreator/src/python \ ../../qtcreator/src/qnx \ ../../qtcreator/src/qtquick/creator-only \ + ../../qtcreator/src/reference \ ../../qtcreator/src/user-interface/creator-only \ ../../qtcreator/src/vcs/creator-only \ ../../qtcreator/src/widgets \ From 2d7a07e9dd3176ea366859873c0567ee694456ff Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 23 Aug 2024 09:13:20 +0200 Subject: [PATCH 22/27] Debugger: reenable 32 bit cdb detection The 64 bit cdb has unfortunately limited 32 bit debugging capabilities and there are still a bunch of users that still need to work with 32 bit MSVC builds. Also add functionality to reset the 64 bit cdb in kits with a 32 bit toolchain. This reverts commit 9a06e1f65c25424696ad9a1ced5eec7560f30f80. This reverts commit 421210e609f865aeaf18e0a6e02c1bf3b4339892. Task-number: QTCREATORBUG-31345 Change-Id: I072353b8ab6a2b93594dd4f11ecd17ca031ab6ec Reviewed-by: Cristian Adam Reviewed-by: Christian Stenger --- src/plugins/debugger/debuggeritem.cpp | 7 ++----- src/plugins/debugger/debuggeritemmanager.cpp | 8 +------- src/plugins/debugger/debuggerkitaspect.cpp | 19 +++++++++++++++---- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 120684c9fe4..455b4e39862 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -434,11 +434,8 @@ static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &t return matchOnMultiarch; } - if (debuggerAbi.wordWidth() == 64 && targetAbi.wordWidth() == 32) { - return HostOsInfo::isWindowsHost() && engineType == CdbEngineType - ? DebuggerItem::MatchesPerfectly - : DebuggerItem::MatchesSomewhat; - } + if (debuggerAbi.wordWidth() == 64 && targetAbi.wordWidth() == 32) + return DebuggerItem::MatchesSomewhat; if (debuggerAbi.wordWidth() != 0 && debuggerAbi.wordWidth() != targetAbi.wordWidth()) return matchOnMultiarch; diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 23dcee4ee6a..b93e0800dec 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -549,7 +549,7 @@ void DebuggerItemModel::autoDetectCdbDebuggers() for (const QFileInfo &kitFolderFi : kitFolders) { const QString path = kitFolderFi.absoluteFilePath(); - QStringList abis = {"x64"}; + QStringList abis = {"x86", "x64"}; if (HostOsInfo::hostArchitecture() == Utils::OsArchArm64) abis << "arm64"; for (const QString &abi: abis) { @@ -783,12 +783,6 @@ void DebuggerItemModel::readDebuggers(const FilePath &fileName, bool isSystem) .arg(item.command().toUserOutput(), item.id().toString(), fileName.toUserOutput()); continue; } - if (item.engineType() == CdbEngineType - && Abi::abisOfBinary(item.command()).value(0).wordWidth() == 32) { - qWarning() << QString("32 bit CDB \"%1\" (%2) read from \"%3\" dropped since it is not supported anymore.") - .arg(item.command().toUserOutput(), item.id().toString(), fileName.toUserOutput()); - continue; - } // FIXME: During startup, devices are not yet available, so we cannot check if the file still exists. if (!item.command().needsDevice() && !item.command().isExecutableFile()) { qWarning() << QString("DebuggerItem \"%1\" (%2) read from \"%3\" dropped since the command is not executable.") diff --git a/src/plugins/debugger/debuggerkitaspect.cpp b/src/plugins/debugger/debuggerkitaspect.cpp index 15a3e8827c1..a7496bf6f0f 100644 --- a/src/plugins/debugger/debuggerkitaspect.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -391,10 +391,21 @@ public: void fix(Kit *k) override { const QVariant id = k->value(DebuggerKitAspect::id()); - if (Utils::anyOf(DebuggerItemManager::debuggers(), Utils::equal(&DebuggerItem::id, id))) - return; - k->removeKeySilently(DebuggerKitAspect::id()); - setup(k); + const DebuggerItem debugger = Utils::findOrDefault( + DebuggerItemManager::debuggers(), Utils::equal(&DebuggerItem::id, id)); + if (debugger.isValid() && debugger.engineType() == CdbEngineType) { + const int tcWordWidth = ToolchainKitAspect::targetAbi(k).wordWidth(); + if (Utils::anyOf(debugger.abis(), Utils::equal(&Abi::wordWidth, tcWordWidth))) + return; + + for (const DebuggerItem &item : DebuggerItemManager::debuggers()) { + if (item.engineType() == CdbEngineType + && Utils::anyOf(item.abis(), Utils::equal(&Abi::wordWidth, tcWordWidth))) { + k->setValue(DebuggerKitAspect::id(), item.id()); + return; + } + } + } } KitAspect *createKitAspect(Kit *k) const override From 8b2f634048ed4cb3897d5bab61271ac2805a59d7 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 26 Aug 2024 12:04:29 +0200 Subject: [PATCH 23/27] ProjectExplorer: Properly initialize button states in env widget Fixes: QTCREATORBUG-31483 Change-Id: I773d9daa4eb074fb9c40672c709ece1c0859f649 Reviewed-by: hjk --- src/plugins/projectexplorer/environmentwidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 6ef817d2797..92bd483bc71 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -269,6 +269,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, Type type, QWidget *additi vbox->addWidget(d->m_detailsContainer); + updateButtons(); connect(d->m_model, &QAbstractItemModel::dataChanged, this, &EnvironmentWidget::updateButtons); From df54a15651567e534bdb56c84e357eb2dc81d88b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 26 Aug 2024 12:08:25 +0200 Subject: [PATCH 24/27] UITour: Fix that steps were skipped when clicking text If the mouse was released on the text, we must prevent propagation to the IntroductionWidget itself, or it handles the click again. Fixes: QTCREATORBUG-31447 Change-Id: I1e33d767e7ec3d3ead381890294016140a9952fc Reviewed-by: Alessandro Portale --- src/plugins/welcome/introductionwidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp index 41bd1a93bf1..d414ead37e0 100644 --- a/src/plugins/welcome/introductionwidget.cpp +++ b/src/plugins/welcome/introductionwidget.cpp @@ -157,10 +157,12 @@ bool IntroductionWidget::event(QEvent *e) bool IntroductionWidget::eventFilter(QObject *obj, QEvent *ev) { - if (obj == parent() && ev->type() == QEvent::Resize) + if (obj == parent() && ev->type() == QEvent::Resize) { resizeToParent(); - else if (obj == m_stepText && ev->type() == QEvent::MouseButtonRelease) + } else if (obj == m_stepText && ev->type() == QEvent::MouseButtonRelease) { step(); + return true; + } return QWidget::eventFilter(obj, ev); } From 740135f74d6ca6b7d4aa62bce1644c7f90e7d812 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 26 Aug 2024 13:41:06 +0200 Subject: [PATCH 25/27] ClangFormat: Adapt to upstream API change Change-Id: I171f7432499459a14621c1887e69945ab506a734 Reviewed-by: Artem Sokolovskii --- src/plugins/clangformat/clangformatutils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 7beb062a45e..573b489cea7 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -69,7 +69,11 @@ clang::format::FormatStyle calculateQtcStyle() style.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes; #endif style.BinPackArguments = false; +#if LLVM_VERSION_MAJOR >= 20 + style.BinPackParameters = FormatStyle::BPPS_OnePerLine; +#else style.BinPackParameters = false; +#endif style.BraceWrapping.AfterClass = true; style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never; style.BraceWrapping.AfterEnum = false; From 4ebf7e84153c21f1f6de7d759abc84ca342efa7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 16 Aug 2024 23:58:36 +0200 Subject: [PATCH 26/27] SquishTests: Remove Qt 5.4 kit Amends a1ca3888ba6acdce5da9c0de3cac81588f17a1cc That change only removed the kit's usages in the Python code but did not remove the configuration. Change-Id: I2940884570a2bddcc921318612fb0e1d406d19f8 Reviewed-by: Christian Stenger --- .../unix/QtProject/qtcreator/profiles.xml | 30 ++----------------- .../unix/QtProject/qtcreator/qtversion.xml | 14 ++------- 2 files changed, 5 insertions(+), 39 deletions(-) diff --git a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml index f696a5c0195..319f9f0a213 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml @@ -4,30 +4,6 @@ Profile.0 - - false - - - - {70e26273-2c0b-4534-bbc0-eb6ca670821a} - Desktop Device - Desktop - - - ProjectExplorer.ToolChain.Gcc:{c3f59b87-6997-4bd8-8067-ee04dc536371} - - 13 - - :///DESKTOP/// - {8ca91e21-c12e-4876-85b3-4b2141708acb} - - Desktop 5.4.1 GCC - false - - - - - Profile.1 false @@ -51,7 +27,7 @@ - Profile.2 + Profile.1 false @@ -79,7 +55,7 @@ - Profile.3 + Profile.2 false @@ -104,7 +80,7 @@ Profile.Count - 4 + 3 Profile.Default diff --git a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml index 2b20e63a7a7..fd073c77109 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml @@ -4,16 +4,6 @@ QtVersion.0 - - 13 - Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) - ~/Qt5.4.1/5.4/SQUISH_DEFAULT_COMPILER/bin/qmake - Qt4ProjectManager.QtVersion.Desktop - false - - - - QtVersion.1 15 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) @@ -23,7 +13,7 @@ - QtVersion.2 + QtVersion.1 17 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) @@ -33,7 +23,7 @@ - QtVersion.3 + QtVersion.2 18 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) From 83a310e5cef956ba965c6bf0d17b1d83fe1c4e63 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 26 Aug 2024 10:52:01 +0200 Subject: [PATCH 27/27] Detect "native" host architecture when running in x86 emulation on Windows on ARM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Creator is run as an x64 executable on a Windows on ARM machine, the auto detection of debuggers and compilers will not work as expected without this patch. Change-Id: I8b0b303b1db097f8cd95bb419c6a21b9a15e1ac8 Reviewed-by: David Schulz Reviewed-by: Kai Köhne --- src/libs/utils/hostosinfo.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/hostosinfo.cpp b/src/libs/utils/hostosinfo.cpp index 717dc900cd8..d81e5044875 100644 --- a/src/libs/utils/hostosinfo.cpp +++ b/src/libs/utils/hostosinfo.cpp @@ -31,7 +31,23 @@ bool HostOsInfo::m_useOverrideFileNameCaseSensitivity = false; OsArch HostOsInfo::hostArchitecture() { - static const OsArch arch = osArchFromString(QSysInfo::currentCpuArchitecture()); +#ifdef Q_OS_WIN + // Workaround for Creator running in x86 emulation mode on ARM machines + static const OsArch arch = []() { + const HANDLE procHandle = GetCurrentProcess(); + ushort processMachine; + ushort nativeMachine; + if (IsWow64Process2(procHandle, &processMachine, &nativeMachine) + && nativeMachine == IMAGE_FILE_MACHINE_ARM64) { + return OsArchArm64; + } + + return osArchFromString(QSysInfo::currentCpuArchitecture()); + }(); +#else + static const OsArch arch = osArchFromString(QSysInfo::currentCpuArchitecture()); +#endif + return arch; }