From 6d7e6fe267a990b85419dddcdfa7f91c923f1b24 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 2 Dec 2024 10:55:05 +0100 Subject: [PATCH 01/21] Axivion: Fix settings handling Do not apply settings automatically. Additionally guard against the crash mentioned inside the bugreport. Fixes: QTCREATORBUG-32078 Change-Id: Id8de16171a070672fa18b72eebfef46669874788 Reviewed-by: hjk --- src/plugins/axivion/axivionperspective.cpp | 12 +++++++++--- src/plugins/axivion/axivionsettings.cpp | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/axivion/axivionperspective.cpp b/src/plugins/axivion/axivionperspective.cpp index 16842d79fef..4ee772ade43 100644 --- a/src/plugins/axivion/axivionperspective.cpp +++ b/src/plugins/axivion/axivionperspective.cpp @@ -767,11 +767,17 @@ IssueListSearch IssuesWidget::searchFromUi() const { IssueListSearch search; QTC_ASSERT(m_currentTableInfo, return search); + const int userIndex = m_ownerFilter->currentIndex(); + QTC_ASSERT(userIndex >= 0 && m_userNames.size() > userIndex, return search); + const int versionStartIndex = m_versionStart->currentIndex(); + QTC_ASSERT(versionStartIndex >= 0 && m_versionDates.size() > versionStartIndex, return search); + const int versionEndIndex = m_versionEnd->currentIndex(); + QTC_ASSERT(versionEndIndex >= 0 && m_versionDates.size() > versionEndIndex, return search); search.kind = m_currentPrefix; // not really ui.. but anyhow - search.owner = m_userNames.at(m_ownerFilter->currentIndex()); + search.owner = m_userNames.at(userIndex); search.filter_path = m_pathGlobFilter->text(); - search.versionStart = m_versionDates.at(m_versionStart->currentIndex()); - search.versionEnd = m_versionDates.at(m_versionEnd->currentIndex()); + search.versionStart = m_versionDates.at(versionStartIndex); + search.versionEnd = m_versionDates.at(versionEndIndex); // different approach: checked means disabling in webview, checked here means explicitly request // the checked one, having both checked is impossible (having none checked means fetch both) // reason for different approach: currently poor reflected inside the ui (TODO) diff --git a/src/plugins/axivion/axivionsettings.cpp b/src/plugins/axivion/axivionsettings.cpp index 508f4e47225..0c84f0bd590 100644 --- a/src/plugins/axivion/axivionsettings.cpp +++ b/src/plugins/axivion/axivionsettings.cpp @@ -225,6 +225,7 @@ AxivionSettings &settings() AxivionSettings::AxivionSettings() { setSettingsGroup("Axivion"); + setAutoApply(false); highlightMarks.setSettingsKey("HighlightMarks"); highlightMarks.setLabelText(Tr::tr("Highlight marks")); @@ -490,6 +491,7 @@ void AxivionSettingsWidget::apply() : servers.at(m_dashboardServers->currentIndex()).id; if (settings().updateDashboardServers(servers, selected)) settings().toSettings(); + settings().apply(); } void AxivionSettingsWidget::updateDashboardServers() From f74b3d7673660b6bfd6e45017fc914d8ee485b4b Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 3 Dec 2024 06:15:17 +0100 Subject: [PATCH 02/21] Axivion: Fix url construction We need to encode the project name as it could contain symbols which let further modification of the url fail in unexpected ways. Fixes: QTCREATORBUG-32091 Change-Id: Ic9109aef5b5e64aea48f7dc2068003ca7f54a048 Reviewed-by: hjk --- src/plugins/axivion/axivionplugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 28fb094ae22..897751c6c02 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -361,7 +361,9 @@ static QUrl constructUrl(const QString &projectName, const QString &subPath, con { if (!dd->m_dashboardInfo) return {}; - QUrl url = dd->m_dashboardInfo->source.resolved(QString("api/projects/" + projectName + '/')); + const QByteArray encodedProjectName = QUrl::toPercentEncoding(projectName); + const QUrl path(QString{"api/projects/" + QString::fromUtf8(encodedProjectName) + '/'}); + QUrl url = dd->m_dashboardInfo->source.resolved(path); if (!subPath.isEmpty() && QTC_GUARD(!subPath.startsWith('/'))) url = url.resolved(subPath); if (!query.isEmpty()) From 6614e3c14dcd27376a862387bbf7559d2db551c0 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 18 Nov 2024 10:41:57 +0100 Subject: [PATCH 03/21] LanguageClient: Export function to restart clients for a setting Fixes: QTCREATORBUG-32015 Change-Id: I03d7e78c710a490a19a4e743389868d24ebeae84 Reviewed-by: Sami Shalayel (cherry picked from commit e6592acb5281b2afa5dfe694475075bbdb0dad43) Reviewed-by: Marcus Tillmanns --- .../languageclient/languageclientmanager.cpp | 120 +++++++++--------- .../languageclient/languageclientmanager.h | 1 + 2 files changed, 63 insertions(+), 58 deletions(-) diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index f0bf50c270f..a83b52b6e36 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -294,74 +294,78 @@ void LanguageClientManager::applySettings() const QList restarts = LanguageClientSettings::changedSettings(); LanguageClientSettings::toSettings(Core::ICore::settings(), managerInstance->m_currentSettings); - for (BaseSettings *setting : restarts) { - QList documents; - const QList currentClients = clientsForSetting(setting); - for (Client *client : currentClients) { - documents << managerInstance->m_clientForDocument.keys(client); - shutdownClient(client); + for (BaseSettings *settings : restarts) + applySettings(settings); +} + +void LanguageClientManager::applySettings(BaseSettings *setting) +{ + QList documents; + const QList currentClients = clientsForSetting(setting); + for (Client *client : currentClients) { + documents << managerInstance->m_clientForDocument.keys(client); + shutdownClient(client); + } + for (auto document : std::as_const(documents)) + managerInstance->m_clientForDocument.remove(document); + if (!setting->isValid() || !setting->m_enabled) + return; + switch (setting->m_startBehavior) { + case BaseSettings::AlwaysOn: { + Client *client = startClient(setting); + for (TextEditor::TextDocument *document : std::as_const(documents)) + managerInstance->m_clientForDocument[document] = client; + break; + } + case BaseSettings::RequiresFile: { + Client *client = nullptr; + for (TextEditor::TextDocument *previousDocument : std::as_const(documents)) { + if (setting->m_languageFilter.isSupported(previousDocument)) { + if (!client) + client = startClient(setting); + openDocumentWithClient(previousDocument, client); + } } - for (auto document : std::as_const(documents)) - managerInstance->m_clientForDocument.remove(document); - if (!setting->isValid() || !setting->m_enabled) - continue; - switch (setting->m_startBehavior) { - case BaseSettings::AlwaysOn: { - Client *client = startClient(setting); - for (TextEditor::TextDocument *document : std::as_const(documents)) - managerInstance->m_clientForDocument[document] = client; - break; - } - case BaseSettings::RequiresFile: { - Client *client = nullptr; - for (TextEditor::TextDocument *previousDocument : std::as_const(documents)) { - if (setting->m_languageFilter.isSupported(previousDocument)) { + const QList &openedDocuments = Core::DocumentModel::openedDocuments(); + for (Core::IDocument *document : openedDocuments) { + if (documents.contains(document)) + continue; // already handled above + if (auto textDocument = qobject_cast(document)) { + if (setting->m_languageFilter.isSupported(document)) { if (!client) client = startClient(setting); - openDocumentWithClient(previousDocument, client); + client->openDocument(textDocument); } } - const QList &openedDocuments = Core::DocumentModel::openedDocuments(); - for (Core::IDocument *document : openedDocuments) { - if (documents.contains(document)) - continue; // already handled above - if (auto textDocument = qobject_cast(document)) { - if (setting->m_languageFilter.isSupported(document)) { + } + break; + } + case BaseSettings::RequiresProject: { + const QList &openedDocuments = Core::DocumentModel::openedDocuments(); + QHash clientForProject; + for (Core::IDocument *document : openedDocuments) { + auto textDocument = qobject_cast(document); + if (!textDocument || !setting->m_languageFilter.isSupported(textDocument)) + continue; + const Utils::FilePath filePath = textDocument->filePath(); + for (ProjectExplorer::Project *project : + ProjectExplorer::ProjectManager::projects()) { + if (project->isKnownFile(filePath)) { + Client *client = clientForProject[project]; + if (!client) { + client = startClient(setting, project); if (!client) - client = startClient(setting); - client->openDocument(textDocument); + continue; + clientForProject[project] = client; } + client->openDocument(textDocument); } } - break; - } - case BaseSettings::RequiresProject: { - const QList &openedDocuments = Core::DocumentModel::openedDocuments(); - QHash clientForProject; - for (Core::IDocument *document : openedDocuments) { - auto textDocument = qobject_cast(document); - if (!textDocument || !setting->m_languageFilter.isSupported(textDocument)) - continue; - const Utils::FilePath filePath = textDocument->filePath(); - for (ProjectExplorer::Project *project : - ProjectExplorer::ProjectManager::projects()) { - if (project->isKnownFile(filePath)) { - Client *client = clientForProject[project]; - if (!client) { - client = startClient(setting, project); - if (!client) - continue; - clientForProject[project] = client; - } - client->openDocument(textDocument); - } - } - } - break; - } - default: - break; } + break; + } + default: + break; } } diff --git a/src/plugins/languageclient/languageclientmanager.h b/src/plugins/languageclient/languageclientmanager.h index e14352881d2..d39844e16d0 100644 --- a/src/plugins/languageclient/languageclientmanager.h +++ b/src/plugins/languageclient/languageclientmanager.h @@ -52,6 +52,7 @@ public: const TextEditor::TextDocument *doc, bool onlyReachable = true); static void applySettings(); + static void applySettings(BaseSettings *settings); static QList currentSettings(); static void registerClientSettings(BaseSettings *settings); static void enableClientSettings(const QString &settingsId, bool enable = true); From 485d490422f9ee6ed902ebc8c4b3983eb15e900e Mon Sep 17 00:00:00 2001 From: Lukasz Papierkowski Date: Mon, 2 Dec 2024 16:26:08 +0100 Subject: [PATCH 04/21] Lua: Expose QCursor::pos() within Qt bindings Change-Id: I59c4a08d4331012441b7a9a76895db6310aab583 Reviewed-by: Marcus Tillmanns --- src/plugins/lua/bindings/qt.cpp | 7 +++++++ src/plugins/lua/meta/qt.lua | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/plugins/lua/bindings/qt.cpp b/src/plugins/lua/bindings/qt.cpp index 4e43272d509..8a8b18807e1 100644 --- a/src/plugins/lua/bindings/qt.cpp +++ b/src/plugins/lua/bindings/qt.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -54,6 +55,12 @@ void setupQtModule() qt["clipboard"] = &QApplication::clipboard; + qt.new_usertype( + "QCursor", + sol::no_constructor, + "pos", sol::resolve(&QCursor::pos) + ); + qt.new_usertype( "QFontMetrics", "create", diff --git a/src/plugins/lua/meta/qt.lua b/src/plugins/lua/meta/qt.lua index 22415322090..205d46c4bc8 100644 --- a/src/plugins/lua/meta/qt.lua +++ b/src/plugins/lua/meta/qt.lua @@ -34,6 +34,13 @@ qt.QClipboard = {} ---@return QClipboard globalClipboard The global clipboard object. function qt.clipboard() end +--@class QCursor A Lua wrapper for the Qt `QCursor` class. +qt.QCursor = {} + +---Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates. +---@return QPoint position The position of the cursor. +function qt.QCursor.pos() end + ---@class QFontMetrics A Lua wrapper for the Qt `QFontMetrics` class. qt.QFontMetrics = {} From 1221a9678de22badd0a5f73dee452d9bbef9c4b8 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 28 Nov 2024 08:01:16 +0100 Subject: [PATCH 05/21] LanguageClient: fix opening docs after always on client settings change Change-Id: I16dd336278071ae3175971f3044c8556f20da993 Reviewed-by: Marcus Tillmanns --- .../languageclient/languageclientmanager.cpp | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index a83b52b6e36..8452afada59 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -310,37 +310,29 @@ void LanguageClientManager::applySettings(BaseSettings *setting) managerInstance->m_clientForDocument.remove(document); if (!setting->isValid() || !setting->m_enabled) return; - switch (setting->m_startBehavior) { - case BaseSettings::AlwaysOn: { - Client *client = startClient(setting); - for (TextEditor::TextDocument *document : std::as_const(documents)) - managerInstance->m_clientForDocument[document] = client; - break; - } - case BaseSettings::RequiresFile: { - Client *client = nullptr; + if (setting->m_startBehavior == BaseSettings::AlwaysOn || BaseSettings::RequiresFile) { + auto ensureClient = [setting, client = static_cast(nullptr)]() mutable { + if (!client) + client = startClient(setting); + return client; + }; + if (setting->m_startBehavior == BaseSettings::AlwaysOn) + ensureClient(); + for (TextEditor::TextDocument *previousDocument : std::as_const(documents)) { - if (setting->m_languageFilter.isSupported(previousDocument)) { - if (!client) - client = startClient(setting); - openDocumentWithClient(previousDocument, client); - } + if (setting->m_languageFilter.isSupported(previousDocument)) + openDocumentWithClient(previousDocument, ensureClient()); } const QList &openedDocuments = Core::DocumentModel::openedDocuments(); for (Core::IDocument *document : openedDocuments) { if (documents.contains(document)) continue; // already handled above if (auto textDocument = qobject_cast(document)) { - if (setting->m_languageFilter.isSupported(document)) { - if (!client) - client = startClient(setting); - client->openDocument(textDocument); - } + if (setting->m_languageFilter.isSupported(document)) + ensureClient()->openDocument(textDocument); } } - break; - } - case BaseSettings::RequiresProject: { + } else if (setting->m_startBehavior == BaseSettings::RequiresProject) { const QList &openedDocuments = Core::DocumentModel::openedDocuments(); QHash clientForProject; for (Core::IDocument *document : openedDocuments) { @@ -362,10 +354,6 @@ void LanguageClientManager::applySettings(BaseSettings *setting) } } } - break; - } - default: - break; } } From aad5a6909be34ed00b1fbc55af3732de70ea9e65 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 28 Nov 2024 14:25:09 +0100 Subject: [PATCH 06/21] Lua LS: Use applySettings with specific settings LanguageClientManager::applySettings() does not know when to apply custom settings so we make sure that we explicitly apply our own. Change-Id: I316e94d0fc50eafe59ca83142b367dd07fa5b353 Reviewed-by: David Schulz --- .../lualanguageclient/lualanguageclient.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp b/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp index 83e9ff4abe2..1ce806cf25e 100644 --- a/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp +++ b/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp @@ -308,7 +308,15 @@ public: if (m_aspects) { connect(m_aspects, &AspectContainer::applied, this, [this] { updateOptions(); - LanguageClientManager::applySettings(); + auto settings = Utils::findOr( + LanguageClientManager::currentSettings(), nullptr, [this](BaseSettings *s) { + return s->m_id == m_clientSettingsId; + }); + + if (settings) + LanguageClientManager::applySettings(settings); + else + LanguageClientManager::applySettings(); }); } From 640f2bfb27977fb70948342365b88ca5c6c2989c Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 28 Nov 2024 12:28:36 +0100 Subject: [PATCH 07/21] QmlLS: Fix autoApply assert Change-Id: I4de95c4760bac8526096a0460648c801e0748fe3 Reviewed-by: Sami Shalayel Reviewed-by: Christian Stenger --- src/plugins/qmljseditor/qmljseditorsettings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/qmljseditor/qmljseditorsettings.cpp b/src/plugins/qmljseditor/qmljseditorsettings.cpp index f731e27a0f9..da43798fec6 100644 --- a/src/plugins/qmljseditor/qmljseditorsettings.cpp +++ b/src/plugins/qmljseditor/qmljseditorsettings.cpp @@ -218,6 +218,7 @@ static QVariant fromSettingsTransformation(const QVariant &v) QmlJsEditingSettings::QmlJsEditingSettings() { + setAutoApply(false); const Key group = QmlJSEditor::Constants::SETTINGS_CATEGORY_QML; useQmlls.setSettingsKey(group, USE_QMLLS); From 094fefbd92c067954dc6cf6429acddb08e13540c Mon Sep 17 00:00:00 2001 From: Lukasz Papierkowski Date: Tue, 3 Dec 2024 09:17:51 +0100 Subject: [PATCH 08/21] Lua: Expose hasFocus within TextEditor binding Change-Id: Id16b4f78ccd0229ee1976be377df97ada1594c04 Reviewed-by: Marcus Tillmanns --- src/plugins/lua/bindings/texteditor.cpp | 7 +++++++ src/plugins/lua/meta/texteditor.lua | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/plugins/lua/bindings/texteditor.cpp b/src/plugins/lua/bindings/texteditor.cpp index 0ca9a7f4e93..2a270d52121 100644 --- a/src/plugins/lua/bindings/texteditor.cpp +++ b/src/plugins/lua/bindings/texteditor.cpp @@ -381,6 +381,13 @@ void setupTextEditorModule() "insertText", [](TextEditorPtr editor, const QString &text) { editor->editorWidget()->multiTextCursor().insertText(text); + }, + "hasFocus", + [](const TextEditorPtr &textEditor) { + QTC_ASSERT( + textEditor && textEditor->editorWidget(), + throw sol::error("TextEditor is not valid")); + return textEditor->editorWidget()->hasFocus(); }); result.new_usertype( diff --git a/src/plugins/lua/meta/texteditor.lua b/src/plugins/lua/meta/texteditor.lua index e77e3d5eed5..0007d09a18c 100644 --- a/src/plugins/lua/meta/texteditor.lua +++ b/src/plugins/lua/meta/texteditor.lua @@ -150,6 +150,10 @@ function TextEditor:hasLockedSuggestion() end ---@param text string The text to insert. function TextEditor:insertText(text) end +---Indicates if the editor widget has focus. +---@return boolean hasFocus True if the editor widget has focus, false otherwise. +function TextEditor:hasFocus() end + ---Returns the current editor or nil. ---@return TextEditor|nil editor The currently active editor or nil if there is none. function textEditor.currentEditor() end From 66d3e5102a7840a9c41d6626689dc2fbfdfde616 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 3 Dec 2024 10:08:42 +0100 Subject: [PATCH 09/21] Bump version to 15.0.1 Change-Id: I72f5e95f8e486fe037a4fad5cbe248bbafa40f68 Reviewed-by: Orgad Shaneh --- cmake/QtCreatorIDEBranding.cmake | 4 ++-- qbs/modules/qtc/qtc.qbs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index 182b7369af0..bfb42230025 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "15.0.0") # The IDE version. +set(IDE_VERSION "15.0.1") # The IDE version. set(IDE_VERSION_COMPAT "15.0.0") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "15.0.0") # The IDE display version. +set(IDE_VERSION_DISPLAY "15.0.1") # The IDE display version. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. set(IDE_DISPLAY_NAME "Qt Creator") # The IDE display name. diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 0071c2f840c..2235d7c5ed5 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,10 +4,10 @@ import qbs.FileInfo import qbs.Utilities Module { - property string qtcreator_display_version: '15.0.0' + property string qtcreator_display_version: '15.0.1' property string ide_version_major: '15' property string ide_version_minor: '0' - property string ide_version_release: '0' + property string ide_version_release: '1' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release From 2103a9a77c12f7f4416ca87c4ceac7af86a0ad81 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 28 Nov 2024 17:50:31 +0100 Subject: [PATCH 10/21] CMakePM: Fix loading conan projects that specifcy CMakeDeps generator `conan_install` will error out if the `-g CMakeDeps` argument is passed and inside the conanfile.py the CMakeDeps generator is also used. Fixes: QTCREATORBUG-32076 Change-Id: I6ba3f3dc6238d0f24837a13969361821b4a5a5a4 Reviewed-by: Marcus Tillmanns --- src/share/3rdparty/package-manager/auto-setup.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/share/3rdparty/package-manager/auto-setup.cmake b/src/share/3rdparty/package-manager/auto-setup.cmake index 867b7f41ee6..9928780d04c 100644 --- a/src/share/3rdparty/package-manager/auto-setup.cmake +++ b/src/share/3rdparty/package-manager/auto-setup.cmake @@ -110,6 +110,14 @@ macro(qtc_auto_setup_conan) file(COPY "${conanfile_txt}" DESTINATION "${CMAKE_BINARY_DIR}/conan-dependencies/") + # conanfile should have a generator specified, when both file and conan_install + # specifcy the CMakeDeps generator, conan_install will issue an error + file(READ "${conanfile_txt}" conanfile_text_content) + unset(conan_generator) + if (NOT "${conanfile_text_content}" MATCHES ".*CMakeDeps.*") + set(conan_generator "-g CMakeDeps") + endif() + file(WRITE "${CMAKE_BINARY_DIR}/conan-dependencies/toolchain.cmake" " set(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\") set(CMAKE_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\") @@ -143,7 +151,7 @@ macro(qtc_auto_setup_conan) -pr \"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\" --build=${QT_CREATOR_CONAN_BUILD_POLICY} -s build_type=\${type} - -g CMakeDeps) + ${conan_generator}) endforeach() get_property(CONAN_INSTALL_SUCCESS GLOBAL PROPERTY CONAN_INSTALL_SUCCESS) From 1dd900f9f5812e0f63d6cdcca35c388e08ac05e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Sat, 30 Nov 2024 00:50:35 +0100 Subject: [PATCH 11/21] SquishTests: Wait for expected function context in tst_CSUP01 Fixing related comment along the way. Change-Id: Ie5dcfd5795c934f407acf772a531a367e4ab7213 Reviewed-by: Christian Stenger --- tests/system/suite_CSUP/tst_CSUP01/test.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/system/suite_CSUP/tst_CSUP01/test.py b/tests/system/suite_CSUP/tst_CSUP01/test.py index 0e443d4d89c..dc10c799ad9 100644 --- a/tests/system/suite_CSUP/tst_CSUP01/test.py +++ b/tests/system/suite_CSUP/tst_CSUP01/test.py @@ -52,6 +52,14 @@ def main(): earlyExit("Did not find first line in function block.") return type(editorWidget, "") + if useClang: + codeModelInMain = lambda: object.exists( + "{currentText='main(int, char **) -> int '" + " type='QComboBox' unnamed='1' visible='1'" + " window=':Qt Creator_Core::Internal::MainWindow'}") + if not waitFor(codeModelInMain, 5000): + test.warning("ComboBox does not display expected main function", + "Did this slow down or did the displayed content change?") type(editorWidget, "re") triggerCompletion(editorWidget) functionName = "realpath" @@ -63,7 +71,7 @@ def main(): test.compare(str(lineUnderCursor(editorWidget)).strip(), functionName + "()", "Step 3: Verifying if: The list of suggestions is opened. It is " "possible to select one of the suggestions.") -# Step 4: Insert text "voi" to new line and press Tab. +# Step 4: Insert text "unsig" to new line and press Tab. resetLine(editorWidget) type(editorWidget, "unsig") try: From 8937d9d142831612ce5622ad57e71ac1efcbd466 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 15 Nov 2024 11:12:42 +0100 Subject: [PATCH 12/21] LanguageClient: fix hasItemsToPropose check in completion model Prefilter the candidates before checking whether the item is a perfect match allows to ignore items that are part of the inserted code to complete. In the example of QTCREATORBUG-32013 tex matched against x and returned a perfect match in that case. If the model reports a perfect match the completion widget is not shown by default but needs to be triggered explicitly. Fixes: QTCREATORBUG-32013 Change-Id: Icd1da6163f0bee2ff09a37456dd51b350fd4fe10 Reviewed-by: Christian Stenger --- .../languageclient/languageclientcompletionassist.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/languageclient/languageclientcompletionassist.cpp b/src/plugins/languageclient/languageclientcompletionassist.cpp index 7919de0de81..7b2d4b02d45 100644 --- a/src/plugins/languageclient/languageclientcompletionassist.cpp +++ b/src/plugins/languageclient/languageclientcompletionassist.cpp @@ -347,11 +347,16 @@ public: {} // IAssistProposal interface - bool hasItemsToPropose(const QString &/*text*/, AssistReason reason) const override + bool hasItemsToPropose(const QString &prefix, AssistReason reason) const override { if (m_model->size() <= 0 || m_document.isNull()) return false; + if (!prefix.isEmpty()) { + m_model->filter(prefix); + m_model->setPrefilterPrefix(prefix); + } + return m_model->keepPerfectMatch(reason) || !Utils::anyOf(m_model->items(), [this](AssistProposalItemInterface *item){ if (const auto lcItem = dynamic_cast(item)) From 9a5c8c90524406a8ded17166f95749e32722447a Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 2 Dec 2024 09:36:04 +0100 Subject: [PATCH 13/21] LanguageClient: Export function to write settings Change-Id: If44990171c98e078e3cbf6db583049eeb019fd34 Reviewed-by: David Schulz --- src/plugins/languageclient/languageclientmanager.cpp | 7 ++++++- src/plugins/languageclient/languageclientmanager.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index 8452afada59..ad2e3044cc5 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -285,6 +285,11 @@ QList LanguageClientManager::clientsSupportingDocument( [doc](Client *client) { return client->isSupportedDocument(doc); }); } +void LanguageClientManager::writeSettings() +{ + LanguageClientSettings::toSettings(Core::ICore::settings(), managerInstance->m_currentSettings); +} + void LanguageClientManager::applySettings() { QTC_ASSERT(managerInstance, return); @@ -292,7 +297,7 @@ void LanguageClientManager::applySettings() managerInstance->m_currentSettings = Utils::transform(LanguageClientSettings::pageSettings(), &BaseSettings::copy); const QList restarts = LanguageClientSettings::changedSettings(); - LanguageClientSettings::toSettings(Core::ICore::settings(), managerInstance->m_currentSettings); + writeSettings(); for (BaseSettings *settings : restarts) applySettings(settings); diff --git a/src/plugins/languageclient/languageclientmanager.h b/src/plugins/languageclient/languageclientmanager.h index d39844e16d0..8548419093d 100644 --- a/src/plugins/languageclient/languageclientmanager.h +++ b/src/plugins/languageclient/languageclientmanager.h @@ -53,6 +53,7 @@ public: static void applySettings(); static void applySettings(BaseSettings *settings); + static void writeSettings(); static QList currentSettings(); static void registerClientSettings(BaseSettings *settings); static void enableClientSettings(const QString &settingsId, bool enable = true); From 4a041f8a74dec1cbc536eff020cbcf1aa3499665 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 3 Dec 2024 10:19:18 +0100 Subject: [PATCH 14/21] LuaLS: Write settings after applying Change-Id: I87cf48eee3c8df4481a672c31e6adf58ed1ec155 Reviewed-by: David Schulz --- .../languageclient/lualanguageclient/lualanguageclient.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp b/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp index 1ce806cf25e..9685d91cabc 100644 --- a/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp +++ b/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp @@ -313,10 +313,12 @@ public: return s->m_id == m_clientSettingsId; }); - if (settings) + if (settings) { LanguageClientManager::applySettings(settings); - else + LanguageClientManager::writeSettings(); + } else { LanguageClientManager::applySettings(); + } }); } From 8a708b437a8674d5fb967b7eede493b9de6112d2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Wed, 4 Dec 2024 09:27:30 +0100 Subject: [PATCH 15/21] Utils: Don't start at end of Markdown document QTextEdit::show will try to scroll so that the cursor is visible. By default the cursor is at the end of the document after ::setMarkdown(). To counteract we reset the cursor to the top. Change-Id: I0e25878f32775de715fd4789d45274492b2981fe Reviewed-by: Alessandro Portale --- src/libs/utils/markdownbrowser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/utils/markdownbrowser.cpp b/src/libs/utils/markdownbrowser.cpp index e15323058cb..84a85eafaf9 100644 --- a/src/libs/utils/markdownbrowser.cpp +++ b/src/libs/utils/markdownbrowser.cpp @@ -413,6 +413,9 @@ void MarkdownBrowser::setMarkdown(const QString &markdown) { document()->setMarkdown(markdown); postProcessDocument(true); + // Reset cursor to start of the document, so that "show" does not + // scroll to the end of the document. + setTextCursor(QTextCursor(document())); } void MarkdownBrowser::postProcessDocument(bool firstTime) const From 342875c97a19e4220d49b1e800b4d9210a9a0bd0 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 3 Dec 2024 12:19:01 +0100 Subject: [PATCH 16/21] Core: Fix displaying tool tips for navigation buttons Change-Id: I90e6cf8160323e29e07844959508c9473fcccf09 Reviewed-by: David Schulz --- src/plugins/coreplugin/editortoolbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 75ca726ec9e..6b4147c8f2f 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -378,8 +378,8 @@ void EditorToolBar::setGoForwardMenu(QMenu *menu) void EditorToolBar::updateActionShortcuts() { d->m_closeEditorButton->setToolTip(ActionManager::command(Constants::CLOSE)->stringWithAppendedShortcut(Tr::tr("Close Document"))); - d->m_goBackAction->setToolTip(ActionManager::command(Constants::GO_BACK)->action()->toolTip()); - d->m_goForwardAction->setToolTip(ActionManager::command(Constants::GO_FORWARD)->action()->toolTip()); + d->m_goBackAction->setToolTip(ActionManager::command(Constants::GO_BACK)->stringWithAppendedShortcut(Tr::tr("Go Back"))); + d->m_goForwardAction->setToolTip(ActionManager::command(Constants::GO_FORWARD)->stringWithAppendedShortcut(Tr::tr("Go Forward"))); d->m_closeSplitButton->setToolTip(ActionManager::command(Constants::REMOVE_CURRENT_SPLIT)->stringWithAppendedShortcut(Tr::tr("Remove Split"))); } From 22a694e7d07b112b6aba55d746154e75da983400 Mon Sep 17 00:00:00 2001 From: Patryk Stachniak Date: Mon, 2 Dec 2024 12:33:14 +0100 Subject: [PATCH 17/21] Ensure UI tour starts with Icons and Text mode Changed runUiTour to set mode style to Icons and Text before starting the UI tour. This ensures a consistent user experience during the tour. After the tour, the previous mode style is restored to maintain user preferences. Task-number: QTCREATORBUG-31979 Change-Id: I0e303cad9afd4fd99dc76a342ebc8408c3a1a5f7 Reviewed-by: Eike Ziller (cherry picked from commit 8cc973371d7e9d575161bdf330f32fb311b9432e) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/welcome/introductionwidget.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp index 1869947503f..bc9b80c3284 100644 --- a/src/plugins/welcome/introductionwidget.cpp +++ b/src/plugins/welcome/introductionwidget.cpp @@ -5,6 +5,7 @@ #include "welcometr.h" #include +#include #include #include @@ -40,7 +41,7 @@ struct Item class IntroductionWidget : public QWidget { public: - IntroductionWidget(); + IntroductionWidget(Core::ModeManager::Style previousModeStyle); protected: bool event(QEvent *e) override; @@ -63,12 +64,16 @@ private: std::vector m_items; QPointer m_stepPointerAnchor; uint m_step = 0; + Core::ModeManager::Style m_previousModeStyle; }; -IntroductionWidget::IntroductionWidget() +IntroductionWidget::IntroductionWidget(Core::ModeManager::Style previousModeStyle) : QWidget(ICore::dialogParent()), - m_borderImage(":/welcome/images/border.png") + m_borderImage(":/welcome/images/border.png"), + m_previousModeStyle(previousModeStyle) { + Core::ModeManager::setModeStyle(Core::ModeManager::Style::IconsAndText); + setFocusPolicy(Qt::StrongFocus); setFocus(); parentWidget()->installEventFilter(this); @@ -363,6 +368,7 @@ void IntroductionWidget::mouseReleaseEvent(QMouseEvent *me) void IntroductionWidget::finish() { + Core::ModeManager::setModeStyle(m_previousModeStyle); hide(); deleteLater(); } @@ -405,7 +411,7 @@ void IntroductionWidget::resizeToParent() void runUiTour() { - auto intro = new IntroductionWidget; + auto intro = new IntroductionWidget(Core::ModeManager::modeStyle()); intro->show(); } From 08870178bb2bb6a33c6fdba2bc30bf9128db37b3 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Wed, 4 Dec 2024 15:31:56 +0100 Subject: [PATCH 18/21] CmdBridge: Add .exe to binaries on Windows Task-number: QTCREATORBUG-32101 Change-Id: I9ee7b536f04242a2a2e53056dd5f65d4794fad08 Reviewed-by: Cristian Adam --- src/libs/gocmdbridge/client/cmdbridgeclient.cpp | 5 ++++- src/libs/gocmdbridge/server/CMakeLists.txt | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libs/gocmdbridge/client/cmdbridgeclient.cpp b/src/libs/gocmdbridge/client/cmdbridgeclient.cpp index a52136d22aa..a88ab332bcd 100644 --- a/src/libs/gocmdbridge/client/cmdbridgeclient.cpp +++ b/src/libs/gocmdbridge/client/cmdbridgeclient.cpp @@ -920,7 +920,10 @@ expected_str Client::getCmdBridgePath( const QString type = typeToString.value(osType); const QString arch = archToString.value(osArch); - const QString cmdBridgeName = QStringLiteral("cmdbridge-%1-%2").arg(type, arch); + QString cmdBridgeName = QStringLiteral("cmdbridge-%1-%2").arg(type, arch); + + if (osType == OsType::OsTypeWindows) + cmdBridgeName += QStringLiteral(".exe"); const FilePath result = libExecPath.resolvePath(cmdBridgeName); if (result.exists()) diff --git a/src/libs/gocmdbridge/server/CMakeLists.txt b/src/libs/gocmdbridge/server/CMakeLists.txt index bc4ef75f258..a5462076546 100644 --- a/src/libs/gocmdbridge/server/CMakeLists.txt +++ b/src/libs/gocmdbridge/server/CMakeLists.txt @@ -8,6 +8,10 @@ function(go_build NAME SOURCES PLATFORMS ARCHITECTURES LDFLAGS) set(TARGET_NAME ${NAME}-${PLATFORM}-${ARCHITECTURE}) set(OUTPUT ${OUTPUT_FOLDER}/${TARGET_NAME}) + if (${PLATFORM} STREQUAL "windows") + string(APPEND OUTPUT ".exe") + endif() + if ((${PLATFORM} STREQUAL "linux" OR (${PLATFORM} STREQUAL "windows" AND ${ARCHITECTURE} STREQUAL "amd64")) AND NOT UPX_BIN STREQUAL "UPX_BIN-NOTFOUND") add_custom_command( OUTPUT "${OUTPUT}" From 91fcdcce2d45e973d4c061572a4500516767969d Mon Sep 17 00:00:00 2001 From: Krzysztof Chrusciel Date: Tue, 3 Dec 2024 12:11:10 +0100 Subject: [PATCH 19/21] Lua: Export sizePolicy parameter for Widgets Extend lua bindings to support horizontal and vertical size policies. Change-Id: I663b17bd11086efd2cbf430aace800fde55b6c0d Reviewed-by: Marcus Tillmanns --- src/libs/utils/layoutbuilder.cpp | 6 ++++++ src/libs/utils/layoutbuilder.h | 3 +++ src/plugins/lua/bindings/gui.cpp | 17 +++++++++++++++++ src/plugins/lua/meta/gui.lua | 15 +++++++++++++++ 4 files changed, 41 insertions(+) diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index ea873b6151c..3caeca5664d 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -791,6 +792,11 @@ void Widget::setCursor(Qt::CursorShape shape) access(this)->setCursor(shape); } +void Widget::setSizePolicy(const QSizePolicy &policy) +{ + access(this)->setSizePolicy(policy); +} + void Widget::activateWindow() { access(this)->activateWindow(); diff --git a/src/libs/utils/layoutbuilder.h b/src/libs/utils/layoutbuilder.h index 12349149cde..f195f30ca06 100644 --- a/src/libs/utils/layoutbuilder.h +++ b/src/libs/utils/layoutbuilder.h @@ -31,6 +31,7 @@ class QObject; class QPushButton; class QScrollArea; class QSize; +class QSizePolicy; class QSpinBox; class QSplitter; class QStackedWidget; @@ -250,6 +251,7 @@ public: void setAutoFillBackground(bool); void setLayout(const Layout &layout); void setSize(int, int); + void setSizePolicy(const QSizePolicy &policy); void setFixedSize(const QSize &); void setWindowTitle(const QString &); void setWindowFlags(Qt::WindowFlags); @@ -537,6 +539,7 @@ QTC_DEFINE_BUILDER_SETTER(widgetAttribute, setWidgetAttribute); QTC_DEFINE_BUILDER_SETTER(autoFillBackground, setAutoFillBackground); QTC_DEFINE_BUILDER_SETTER(readOnly, setReadOnly); QTC_DEFINE_BUILDER_SETTER(markdown, setMarkdown); +QTC_DEFINE_BUILDER_SETTER(sizePolicy, setSizePolicy); QTC_DEFINE_BUILDER_SETTER(basePath, setBasePath); QTC_DEFINE_BUILDER_SETTER(fixedSize, setFixedSize); diff --git a/src/plugins/lua/bindings/gui.cpp b/src/plugins/lua/bindings/gui.cpp index c9b2a9dc1e4..aae28b7ddcf 100644 --- a/src/plugins/lua/bindings/gui.cpp +++ b/src/plugins/lua/bindings/gui.cpp @@ -88,6 +88,7 @@ CREATE_HAS_FUNC(onTextChanged, nullptr, nullptr) CREATE_HAS_FUNC(onClicked, nullptr, nullptr) CREATE_HAS_FUNC(setText, QString()) CREATE_HAS_FUNC(setMarkdown, QString()) +CREATE_HAS_FUNC(setSizePolicy, QSizePolicy()) CREATE_HAS_FUNC(setReadOnly, bool()) CREATE_HAS_FUNC(setTitle, QString()) CREATE_HAS_FUNC(setValue, int()) @@ -290,6 +291,19 @@ void setProperties(std::unique_ptr &item, const sol::table &children, QObject if (markdown) item->setMarkdown(*markdown); } + if constexpr (has_setSizePolicy) { + auto sizePolicy = children.get>("sizePolicy"); + if (sizePolicy) { + QTC_ASSERT( + sizePolicy->size() == 2, + throw sol::error( + "sizePolicy must be array of 2 elements: horizontalPolicy, verticalPolicy.") + ); + auto horizontalPolicy = sizePolicy->get(1); + auto verticalPolicy = sizePolicy->get(2); + item->setSizePolicy(QSizePolicy(horizontalPolicy, verticalPolicy)); + } + } if constexpr (has_setTitle) { item->setTitle(children.get_or("title", "")); } @@ -552,6 +566,9 @@ void setupGuiModule() mirrorEnum(gui, QMetaEnum::fromType()); mirrorEnum(gui, QMetaEnum::fromType()); + auto sizePolicy = gui.create_named("QSizePolicy"); + mirrorEnum(sizePolicy, QMetaEnum::fromType()); + gui.new_usertype( "Stack", sol::call_constructor, diff --git a/src/plugins/lua/meta/gui.lua b/src/plugins/lua/meta/gui.lua index 7f95709ec85..a12173f96a8 100644 --- a/src/plugins/lua/meta/gui.lua +++ b/src/plugins/lua/meta/gui.lua @@ -26,6 +26,7 @@ gui.widget = {} ---@field windowFlags? WindowType[] The window flags of the widget. ---@field widgetAttributes? WidgetAttributeMapT The widget attributes of the widget. ---@field autoFillBackground? boolean A boolean, representing whether the widget should automatically fill its background. +---@field sizePolicy? SizePolicy.Policy[] Two size policies of the widget, horizontal and vertical. gui.baseWidgetOptions = {} ---@class (exact) WidgetOptions : BaseWidgetOptions @@ -460,6 +461,20 @@ gui.CursorShape = { CustomCursor = 0 } +gui.SizePolicy = { + --- Enum representing size policy. + ---@enum Policy + Policy = { + Fixed = 0, + Minimum = 0, + Maximum = 0, + Preferred = 0, + MinimumExpanding = 0, + Expanding = 0, + Ignored = 0 + } +} + ---@class Space : Layout gui.space = {} From b028976509bf1028b66ed91265f7dce76f7ad440 Mon Sep 17 00:00:00 2001 From: Andrii Semkiv Date: Fri, 29 Nov 2024 15:21:27 +0100 Subject: [PATCH 20/21] Clang Format: Fix partially initialized style "Always initialize an object". `clang::format::FormatStyle` does not have a default constructor, so the options that are not explicitly specified in the config had garbage values. Improved error reporting. Task-number: QTCREATORBUG-32051 Change-Id: Id5d5d1b8247b61725644e0aa5f774e35635fcb41 Reviewed-by: hjk --- src/plugins/clangformat/clangformatbaseindenter.cpp | 10 ++++++++-- src/plugins/clangformat/clangformatconfigwidget.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index cf48f4d61b5..7b4549a9b41 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -930,8 +930,14 @@ clang::format::FormatStyle ClangFormatBaseIndenterPrivate::customSettingsStyle( return currentQtStyle(preferences); clang::format::FormatStyle currentSettingsStyle; - const Utils::expected_str success = parseConfigurationFile(filePath, currentSettingsStyle); - QTC_ASSERT(success, return currentQtStyle(preferences)); + const Utils::expected_str result = parseConfigurationFile(filePath, currentSettingsStyle); + if (!result) { + qCWarning(clangIndenterLog) + << QString{"Failed to parse config %1. Falling back to the Qt style."}.arg( + filePath.toUserOutput()) + << result.error(); + return currentQtStyle(preferences); + }; return currentSettingsStyle; } diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index 56a51ef83de..9d65daadcee 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -201,7 +201,7 @@ void ClangFormatConfigWidget::initEditor() this); connect(m_editor->document(), &TextEditor::TextDocument::contentsChanged, this, [this] { - clang::format::FormatStyle currentSettingsStyle; + clang::format::FormatStyle currentSettingsStyle{}; const Utils::expected_str success = parseConfigurationContent(m_editor->document()->contents().toStdString(), currentSettingsStyle); From 9e35457b59b4db0c7b85b0567c6665b248dc21ee Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 5 Dec 2024 11:38:15 +0100 Subject: [PATCH 21/21] QtC plugin wizard: Fix downloading Qt with GitHub action The layout of the installer components and the layout within the archives changed. Fixes: QTCREATORBUG-32090 Change-Id: I4218d426f06c022d1ee0f5eee6cd9fbf6cf881cb Reviewed-by: Cristian Adam --- .../github_workflows_build_cmake.yml | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) 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 09cb8f2d2f9..84a5a24c76a 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml @@ -87,56 +87,54 @@ jobs: string(REPLACE "." "" qt_version_dotless "${qt_version}") if ("${{ runner.os }}" STREQUAL "Windows") set(url_os "windows_x86") - set(qt_package_arch_suffix "win64_msvc2019_64") - set(qt_dir_prefix "${qt_version}/msvc2019_64") - set(qt_package_suffix "-Windows-Windows_10_22H2-MSVC2019-Windows-Windows_10_22H2-X86_64") + set(qt_package_arch_suffix "win64_msvc2022_64") + set(qt_dir_prefix "${qt_version}/msvc_64") + set(qt_package_suffix "-Windows-Windows_11_23H2-MSVC2022-Windows-Windows_11_23H2-X86_64") elseif ("${{ runner.os }}" STREQUAL "Linux") set(url_os "linux_x64") - if (qt_version VERSION_LESS "6.7.0") - set(qt_package_arch_suffix "gcc_64") - else() - set(qt_package_arch_suffix "linux_gcc_64") - endif() + set(qt_package_arch_suffix "linux_gcc_64") set(qt_dir_prefix "${qt_version}/gcc_64") - set(qt_package_suffix "-Linux-RHEL_8_8-GCC-Linux-RHEL_8_8-X86_64") + set(qt_package_suffix "-Linux-RHEL_8_10-GCC-Linux-RHEL_8_10-X86_64") elseif ("${{ runner.os }}" STREQUAL "macOS") set(url_os "mac_x64") set(qt_package_arch_suffix "clang_64") set(qt_dir_prefix "${qt_version}/macos") - set(qt_package_suffix "-MacOS-MacOS_13-Clang-MacOS-MacOS_13-X86_64-ARM64") + set(qt_package_suffix "-MacOS-MacOS_14-Clang-MacOS-MacOS_14-X86_64-ARM64") endif() - set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt6_${qt_version_dotless}") + set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt6_${qt_version_dotless}/qt6_${qt_version_dotless}") file(DOWNLOAD "${qt_base_url}/Updates.xml" ./Updates.xml SHOW_PROGRESS) file(READ ./Updates.xml updates_xml) string(REGEX MATCH "qt.qt6.*([0-9+-.]+)" updates_xml_output "${updates_xml}") set(qt_package_version ${CMAKE_MATCH_1}) - file(MAKE_DIRECTORY qt6) - # Save the path for other steps file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt6/${qt_dir_prefix}" qt_dir) file(APPEND "$ENV{GITHUB_OUTPUT}" "qt_dir=${qt_dir}") message("Downloading Qt to ${qt_dir}") - function(downloadAndExtract url archive) + function(downloadAndExtract url archive subdir) + file(MAKE_DIRECTORY "${qt_dir}/${subdir}") message("Downloading ${url}") - file(DOWNLOAD "${url}" ./${archive} SHOW_PROGRESS) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${archive} WORKING_DIRECTORY qt6) + message("... extracting to ${qt_dir}/${subdir}") + file(DOWNLOAD "${url}" "$ENV{GITHUB_WORKSPACE}/${archive}" SHOW_PROGRESS) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "$ENV{GITHUB_WORKSPACE}/${archive}" WORKING_DIRECTORY "${qt_dir}/${subdir}") endfunction() foreach(package qtbase qtdeclarative) downloadAndExtract( "${qt_base_url}/qt.qt6.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" ${package}.7z + "" ) endforeach() foreach(package qt5compat qtshadertools) downloadAndExtract( - "${qt_base_url}/qt.qt6.${qt_version_dotless}.${package}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" + "${qt_base_url}/qt.qt6.${qt_version_dotless}.addons.${package}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z" ${package}.7z + "" ) endforeach() @@ -150,9 +148,11 @@ jobs: downloadAndExtract( "${qt_base_url}/qt.qt6.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}icu-linux-${uic_suffix}.7z" icu.7z + "lib" ) endif() + execute_process(COMMAND ${qt_dir}/bin/qmake -query) - name: Download Qt Creator uses: qt-creator/install-dev-package@v1.2 with: