From e3c1179abbd81fda7011e79ae20c10de9573b001 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 6 Nov 2023 13:41:39 +0100 Subject: [PATCH 01/19] CppEditor: Manually indent moved comments Using the indenter yields unepected results in certain contexts. Fixes: QTCREATORBUG-29786 Change-Id: Id15eff841d2aa54e7fff65c6bf728516e03f9fc6 Reviewed-by: David Schulz Reviewed-by: Christian Kandeler --- src/plugins/cppeditor/cppquickfix_test.cpp | 16 ++++++-- src/plugins/cppeditor/cppquickfixes.cpp | 45 +++++++++++++++++++++- 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 0c4a07a2c27..d2cf58ebfb4 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -9272,7 +9272,9 @@ template inline T aFunction() { return T(); } const QByteArrayList headersMemberDecl2Def{R"( class C { - // Member function comment + /** + * \brief Foo::aMember + */ void @aMember(); )", R"( class C { @@ -9285,7 +9287,9 @@ void C::aMember() {} )", R"( #include "file.h" -// Member function comment +/** + * \brief Foo::aMember + */ void C::aMember() {} )"}; QTest::newRow("member function: from decl to def") << headersMemberDecl2Def @@ -9296,13 +9300,17 @@ class C { void aMember(); )", R"( class C { - // Member function comment + /** + * \brief Foo::aMember + */ void aMember(); )"}; const QByteArrayList sourcesMemberDef2Decl{R"( #include "file.h" -// Member function comment +/** + * \brief Foo::aMember + */ void C::aMember() {@} )", R"( #include "file.h" diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 7f08b962009..012785df349 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -34,10 +34,13 @@ #include +#include #include #include #include +#include + #include #include #include @@ -9610,7 +9613,45 @@ private: comments.first(), sourceFile->document()); const int sourceCommentEndPos = sourceTu->getTokenEndPositionInDocument( comments.last(), sourceFile->document()); - const QString functionDoc = sourceFile->textOf(sourceCommentStartPos, sourceCommentEndPos); + + // Manually adjust indentation, as both our built-in indenter and ClangFormat + // are unreliable with regards to comment continuation lines. + auto tabSettings = [](CppRefactoringFilePtr file) { + if (auto editor = file->editor()) + return editor->textDocument()->tabSettings(); + return ProjectExplorer::actualTabSettings(file->filePath(), nullptr); + }; + const TabSettings &sts = tabSettings(sourceFile); + const TabSettings &tts = tabSettings(targetFile); + const QTextBlock insertionBlock = targetFile->document()->findBlock(insertionPos); + const int insertionColumn = tts.columnAt(insertionBlock.text(), + insertionPos - insertionBlock.position()); + const QTextBlock removalBlock = sourceFile->document()->findBlock(sourceCommentStartPos); + const QTextBlock removalBlockEnd = sourceFile->document()->findBlock(sourceCommentEndPos); + const int removalColumn = sts.columnAt(removalBlock.text(), + sourceCommentStartPos - removalBlock.position()); + const int columnOffset = insertionColumn - removalColumn; + QString functionDoc; + if (columnOffset != 0) { + for (QTextBlock block = removalBlock; + block.isValid() && block != removalBlockEnd.next(); + block = block.next()) { + QString text = block.text() + QChar::ParagraphSeparator; + if (block == removalBlockEnd) + text = text.left(sourceCommentEndPos - block.position()); + if (block == removalBlock) { + text = text.mid(sourceCommentStartPos - block.position()); + } else { + int lineIndentColumn = sts.indentationColumn(text) + columnOffset; + text.replace(0, + TabSettings::firstNonSpace(text), + tts.indentationString(0, lineIndentColumn, 0, insertionBlock)); + } + functionDoc += text; + } + } else { + functionDoc = sourceFile->textOf(sourceCommentStartPos, sourceCommentEndPos); + } // Remove comment plus leading and trailing whitespace, including trailing newline. const auto removeAtSource = [&](ChangeSet &changeSet) { @@ -9642,10 +9683,10 @@ private: ChangeSet targetChangeSet; targetChangeSet.insert(insertionPos, functionDoc); targetChangeSet.insert(insertionPos, "\n"); + targetChangeSet.insert(insertionPos, QString(insertionColumn, ' ')); if (targetFile == sourceFile) removeAtSource(targetChangeSet); targetFile->setChangeSet(targetChangeSet); - targetFile->appendIndentRange({insertionPos, insertionPos + int(functionDoc.length())}); const bool targetFileSuccess = targetFile->apply(); if (targetFile == sourceFile || !targetFileSuccess) return; From 5b1aa26e47f1c97e7a5f295bb5dbd3a35ece0fb5 Mon Sep 17 00:00:00 2001 From: Semih Yavuz Date: Thu, 9 Nov 2023 13:44:32 +0100 Subject: [PATCH 02/19] Do not use QDir::separator() in QML reformatter test That created a mix of / and \\ while building the path. Qt promises to build paths that conforms to underlying OS if we always use /. Amends ffcbbecf271d23830dbe0515586044ffc05f2fc2 Change-Id: Iebcb739cc02f0a2d6dd8953943ecfa9cf8fc9aea Reviewed-by: hjk --- tests/auto/qml/reformatter/tst_reformatter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qml/reformatter/tst_reformatter.cpp b/tests/auto/qml/reformatter/tst_reformatter.cpp index 748b8b81263..d3fb69cd859 100644 --- a/tests/auto/qml/reformatter/tst_reformatter.cpp +++ b/tests/auto/qml/reformatter/tst_reformatter.cpp @@ -50,8 +50,8 @@ void tst_Reformatter::test_data() // makes a change inline, for example whitespace removal. We omit // those files in this test. QSet excludedFiles; - excludedFiles << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.qml"; - excludedFiles << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.formatted.qml"; + excludedFiles << QString::fromLatin1(TESTSRCDIR) + "/typeAnnotations.qml"; + excludedFiles << QString::fromLatin1(TESTSRCDIR) + "/typeAnnotations.formatted.qml"; QDirIterator it(TESTSRCDIR, QStringList() << QLatin1String("*.qml") << QLatin1String("*.js"), QDir::Files); while (it.hasNext()) { @@ -103,8 +103,8 @@ void tst_Reformatter::reformatter_data() QTest::addColumn("formattedFilePath"); QTest::newRow("typeAnnotations") - << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.qml" - << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.formatted.qml"; + << QString::fromLatin1(TESTSRCDIR) + "/typeAnnotations.qml" + << QString::fromLatin1(TESTSRCDIR) +"/typeAnnotations.formatted.qml"; } void tst_Reformatter::reformatter() From f90f60bb32110d4406038e3184433857c42609af Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 8 Nov 2023 20:28:36 +0100 Subject: [PATCH 03/19] CMake: Fix QTC_STATIC_BUILD Change-Id: Idfcd36f2d5fdaf09c958ff101aa5e83e0a29cb58 Reviewed-by: Eike Ziller --- cmake/Findyaml-cpp.cmake | 5 ++++- cmake/QtCreatorAPI.cmake | 7 ++++++- src/libs/nanotrace/CMakeLists.txt | 1 - src/libs/nanotrace/nanotrace.h | 2 ++ src/libs/solutions/spinner/CMakeLists.txt | 1 - src/libs/solutions/tasking/CMakeLists.txt | 1 - src/libs/utils/CMakeLists.txt | 2 ++ src/libs/utils/externalterminalprocessimpl.cpp | 6 +++--- src/plugins/qmldesigner/CMakeLists.txt | 5 ----- src/plugins/studiowelcome/studiowelcome_global.h | 2 ++ 10 files changed, 19 insertions(+), 13 deletions(-) diff --git a/cmake/Findyaml-cpp.cmake b/cmake/Findyaml-cpp.cmake index 87fbbcd63eb..b79056f67fe 100644 --- a/cmake/Findyaml-cpp.cmake +++ b/cmake/Findyaml-cpp.cmake @@ -123,7 +123,10 @@ else() ${YAML_SOURCE_DIR}/src/tag.h ${YAML_SOURCE_DIR}/src/token.h ) - if (NOT QTC_STATIC_BUILD) + if (QTC_STATIC_BUILD) + extend_qtc_target(yaml-cpp + PUBLIC_DEFINES YAML_CPP_STATIC_DEFINE) + else() extend_qtc_target(yaml-cpp DEFINES yaml_cpp_EXPORTS PUBLIC_DEFINES YAML_CPP_DLL) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 5ae0e25bdc3..66d9407787c 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -211,9 +211,14 @@ function(add_qtc_library name) ) if (QTC_STATIC_BUILD) - extend_qtc_target(${name} PUBLIC_DEFINES ${EXPORT_SYMBOL}) + extend_qtc_target(${name} + DEFINES ${EXPORT_SYMBOL} + PUBLIC_DEFINES ${EXPORT_SYMBOL}) else() extend_qtc_target(${name} DEFINES ${EXPORT_SYMBOL}) + if (_arg_OBJECT OR _arg_STATIC) + extend_qtc_target(${name} PUBLIC_DEFINES ${EXPORT_SYMBOL}) + endif() endif() # everything is different with SOURCES_PREFIX diff --git a/src/libs/nanotrace/CMakeLists.txt b/src/libs/nanotrace/CMakeLists.txt index 57f11af9970..17e2573829d 100644 --- a/src/libs/nanotrace/CMakeLists.txt +++ b/src/libs/nanotrace/CMakeLists.txt @@ -1,6 +1,5 @@ add_qtc_library(Nanotrace BUILD_DEFAULT OFF - DEFINES NANOTRACE_LIBRARY PUBLIC_DEFINES NANOTRACE_ENABLED SOURCES nanotrace.cpp nanotrace.h PUBLIC_DEPENDS Qt::Core diff --git a/src/libs/nanotrace/nanotrace.h b/src/libs/nanotrace/nanotrace.h index 65bc66d0cf2..4003ae5feb0 100644 --- a/src/libs/nanotrace/nanotrace.h +++ b/src/libs/nanotrace/nanotrace.h @@ -7,6 +7,8 @@ #if defined(NANOTRACE_LIBRARY) # define NANOTRACESHARED_EXPORT Q_DECL_EXPORT +#elif defined(NANOTRACE_STATIC_LIBRARY) +# define NANOTRACESHARED_EXPORT #else # define NANOTRACESHARED_EXPORT Q_DECL_IMPORT #endif diff --git a/src/libs/solutions/spinner/CMakeLists.txt b/src/libs/solutions/spinner/CMakeLists.txt index fad094ccb3d..66fe91f81ee 100644 --- a/src/libs/solutions/spinner/CMakeLists.txt +++ b/src/libs/solutions/spinner/CMakeLists.txt @@ -1,7 +1,6 @@ add_qtc_library(Spinner OBJECT # Never add dependencies to non-Qt libraries for this library DEPENDS Qt::Core Qt::Widgets - PUBLIC_DEFINES SPINNER_LIBRARY SOURCES spinner.cpp spinner.h spinner.qrc diff --git a/src/libs/solutions/tasking/CMakeLists.txt b/src/libs/solutions/tasking/CMakeLists.txt index ae51b12a7bd..85843368a8e 100644 --- a/src/libs/solutions/tasking/CMakeLists.txt +++ b/src/libs/solutions/tasking/CMakeLists.txt @@ -1,7 +1,6 @@ add_qtc_library(Tasking OBJECT # Never add dependencies to non-Qt libraries for this library DEPENDS Qt::Concurrent Qt::Core Qt::Network - PUBLIC_DEFINES TASKING_LIBRARY SOURCES barrier.cpp barrier.h concurrentcall.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 6a890815d07..40a74bd5e8f 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -3,6 +3,8 @@ add_qtc_library(Utils PUBLIC_DEPENDS Qt::Concurrent Qt::Core Qt::Network Qt::Gui Qt::Widgets Qt::Core5Compat + $<$:Tasking> + $<$:Spinner> SOURCES ../3rdparty/span/span.hpp ../3rdparty/tl_expected/include/tl/expected.hpp diff --git a/src/libs/utils/externalterminalprocessimpl.cpp b/src/libs/utils/externalterminalprocessimpl.cpp index 5182c2c4373..ca178d7bf9c 100644 --- a/src/libs/utils/externalterminalprocessimpl.cpp +++ b/src/libs/utils/externalterminalprocessimpl.cpp @@ -12,7 +12,7 @@ #include #include -Q_LOGGING_CATEGORY(log, "terminal.externalprocess", QtWarningMsg) +Q_LOGGING_CATEGORY(logTE, "terminal.externalprocess", QtWarningMsg) namespace Utils { @@ -155,12 +155,12 @@ expected_str ProcessStubCreator::startStubProcess(const ProcessSetupData QObject::connect(process, &Process::readyReadStandardOutput, process, [process] { const QString output = process->readAllStandardOutput(); if (!output.isEmpty()) - qCWarning(log).noquote() << output; + qCWarning(logTE).noquote() << output; }); QObject::connect(process, &Process::readyReadStandardError, process, [process] { const QString output = process->readAllStandardError(); if (!output.isEmpty()) - qCCritical(log).noquote() << output; + qCCritical(logTE).noquote() << output; }); QObject::connect(process, &Process::done, m_interface, &TerminalInterface::onStubExited); diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 5110d8b7de5..3c41fffd3c9 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -18,8 +18,6 @@ add_feature_info("ProjectStorage" ${USE_PROJECTSTORAGE} "") add_qtc_library(QmlDesignerUtils STATIC DEPENDS Qt::Gui Utils Qt::QmlPrivate Core - DEFINES QMLDESIGNERUTILS_LIBRARY - PUBLIC_DEFINES $<$:QMLDESIGNER_STATIC_LIBRARY> PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR}/utils SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/utils @@ -69,8 +67,6 @@ add_qtc_library(QmlDesignerCore STATIC TextEditor Sqlite DEFINES - QMLDESIGNERCORE_LIBRARY - QMLDESIGNERUTILS_LIBRARY $<$:QDS_USE_PROJECTSTORAGE> INCLUDES ${CMAKE_CURRENT_LIST_DIR} @@ -443,7 +439,6 @@ add_qtc_plugin(QmlDesigner IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\" SHARE_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../../../share/qtcreator/qmldesigner" $<$:QDS_USE_PROJECTSTORAGE> - QMLDESIGNER_LIBRARY QMLDESIGNERCORE_LIBRARY QMLDESIGNERUTILS_LIBRARY INCLUDES ${CMAKE_CURRENT_LIST_DIR}/components ${CMAKE_CURRENT_LIST_DIR}/components/assetslibrary diff --git a/src/plugins/studiowelcome/studiowelcome_global.h b/src/plugins/studiowelcome/studiowelcome_global.h index 6820e77f680..821d4fd81dd 100644 --- a/src/plugins/studiowelcome/studiowelcome_global.h +++ b/src/plugins/studiowelcome/studiowelcome_global.h @@ -7,6 +7,8 @@ #if defined(STUDIOWELCOME_LIBRARY) # define STUDIOWELCOME_EXPORT Q_DECL_EXPORT +#elif defined(STUDIOWELCOME_STATIC_LIBRARY) +# define STUDIOWELCOME_EXPORT #else # define STUDIOWELCOME_EXPORT Q_DECL_IMPORT #endif From c5cb637b969539a10ffc50b33ecc64085892fd1d Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 10 Nov 2023 12:41:41 +0100 Subject: [PATCH 04/19] SettingsDialog: Use locale aware sorting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Still it's not perfect, as it seems the order is like: "Qt Quick", "Środowisko", "System kontroli wersji", while the proper one should be: "Qt Quick", "System kontroli wersji", "Środowisko", but that's still better than before, when "Środowisko" was after the letter "Z". Change-Id: Ib1642f54ed57f798a614f1f3a2d805fb1fdaf1bc Reviewed-by: Eike Ziller --- src/plugins/coreplugin/dialogs/settingsdialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index d503c71671f..1fd3220680a 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -478,6 +478,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) m_model.setPages(m_pages, IOptionsPageProvider::allOptionsPagesProviders()); + m_proxyModel.setSortLocaleAware(true); m_proxyModel.setSourceModel(&m_model); m_proxyModel.setFilterCaseSensitivity(Qt::CaseInsensitive); m_categoryList->setIconSize(QSize(categoryIconSize, categoryIconSize)); From aef4c32809f83f220a43cfa3ecb8ef0e754a2250 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 10 Nov 2023 16:25:32 +0100 Subject: [PATCH 05/19] CppFileSettingsWidget: Add missing Tr::tr() Change-Id: I1feea8db0597d48f7fb966c786103393d0d91487 Reviewed-by: Eike Ziller --- src/plugins/cppeditor/cppcodemodelsettingspage.cpp | 2 +- src/plugins/cppeditor/cppfilesettingspage.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp index 2c46504f17f..dbd89e48236 100644 --- a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp @@ -294,7 +294,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD d->autoIncludeHeadersCheckBox.setChecked(settings.autoIncludeHeaders()); d->autoIncludeHeadersCheckBox.setToolTip(autoIncludeToolTip); d->threadLimitSpinBox.setValue(settings.workerThreadLimit()); - d->threadLimitSpinBox.setSpecialValueText("Automatic"); + d->threadLimitSpinBox.setSpecialValueText(Tr::tr("Automatic")); d->threadLimitSpinBox.setToolTip(workerThreadsToolTip); d->documentUpdateThreshold.setMinimum(50); d->documentUpdateThreshold.setMaximum(10000); diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index 4303fe67d4f..f9e83e4719b 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -300,7 +300,7 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings) Column { Group { - title("Headers"), + title(Tr::tr("Headers")), Form { Tr::tr("&Suffix:"), m_headerSuffixComboBox, st, br, Tr::tr("S&earch paths:"), m_headerSearchPathsEdit, br, @@ -309,7 +309,7 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings) } }, Group { - title("Sources"), + title(Tr::tr("Sources")), Form { Tr::tr("S&uffix:"), m_sourceSuffixComboBox, st, br, Tr::tr("Se&arch paths:"), m_sourceSearchPathsEdit, br, From 702f4393f92910e5cb4ddfde12c278157104d612 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 13 Nov 2023 08:44:41 +0100 Subject: [PATCH 06/19] Bump version to 12.0.0 Change-Id: I47191ac3dcbfbde7f39bf2d322f8db488648aa35 Reviewed-by: David Schulz --- cmake/QtCreatorIDEBranding.cmake | 6 +++--- qbs/modules/qtc/qtc.qbs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index 5bb17f228bd..6165cd3688b 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "11.0.84") # The IDE version. -set(IDE_VERSION_COMPAT "11.0.84") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "12.0.0-rc1") # The IDE display version. +set(IDE_VERSION "12.0.0") # The IDE version. +set(IDE_VERSION_COMPAT "12.0.0") # The IDE Compatibility version. +set(IDE_VERSION_DISPLAY "12.0.0") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index b8e5aac0e35..79d0b0d5cf2 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,16 +4,16 @@ import qbs.FileInfo import qbs.Utilities Module { - property string qtcreator_display_version: '12.0.0-rc1' - property string ide_version_major: '11' + property string qtcreator_display_version: '12.0.0' + property string ide_version_major: '12' property string ide_version_minor: '0' - property string ide_version_release: '84' + property string ide_version_release: '0' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release - property string ide_compat_version_major: '11' + property string ide_compat_version_major: '12' property string ide_compat_version_minor: '0' - property string ide_compat_version_release: '84' + property string ide_compat_version_release: '0' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release From eb9c2da7264f07cb31ba22c04370099ee5770d5e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 31 Oct 2023 16:01:44 +0100 Subject: [PATCH 07/19] Doc: Turn Managing Sessions into a how-to topic Task-number: QTCREATORBUG-29361 Change-Id: If15556fdcb5d365b65f1f56a77ab9c21739d0854 Reviewed-by: Reviewed-by: Eike Ziller --- doc/qtcreator/src/editors/creator-locator.qdoc | 2 +- .../creator-only/creator-clang-codemodel.qdoc | 2 +- .../src/howto/creator-only/creator-cli.qdoc | 8 +++----- .../src/howto/creator-only/creator-how-tos.qdoc | 2 +- doc/qtcreator/src/howto/creator-sessions.qdoc | 15 +++++++++++---- .../creator-only/creator-projects-overview.qdoc | 14 ++------------ .../creator-projects-settings-dependencies.qdoc | 2 +- doc/qtcreator/src/qtcreator-toc.qdoc | 1 - doc/qtcreator/src/qtcreator.qdoc | 1 - .../src/user-interface/creator-projects-view.qdoc | 2 +- doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc | 2 +- 11 files changed, 22 insertions(+), 29 deletions(-) diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index 44cdc361bc7..49f79876785 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -170,7 +170,7 @@ \section2 Opening Sessions from Locator You can use the filter that triggers menu commands to open - \l{Managing Sessions}{sessions}. Enter + \l{Manage sessions}{sessions}. Enter \c {t yoursess} or \c {t sess yoursess} to trigger \uicontrol File > \uicontrol Sessions > \e . diff --git a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc index 0edfdcc22c7..ed812bed750 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc @@ -149,7 +149,7 @@ \image qtcreator-toggle-progress-bar.webp {Toggle Progress Details button} By default, \QC runs one clangd process per project. If you have created - \l{Managing Sessions}{sessions} that have related projects, you can + \l{Manage sessions}{sessions} that have related projects, you can specify that the projects in the session should be managed by a single clangd process. diff --git a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc index b11cab2a52e..3b2eb93bfc3 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc @@ -197,15 +197,13 @@ \li -lastsession \li ProjectExplorer plugin: load the last session when \QC starts. Open the projects and files that were open when you last exited - \QC. For more information about managing sessions, see - \l{Managing Sessions}. + \QC. \row \li \li ProjectExplorer plugin: load the given session when \QC starts. Open the projects and files that were open when you last exited - \QC. For more information about managing sessions, see - \l{Managing Sessions}. + \QC. \endtable @@ -225,5 +223,5 @@ You can also switch to a dark theme to customize the appearance of widgets, colors, and icons without using stylesheets. - \sa {Run Qt Creator from the command line} + \sa {Run Qt Creator from the command line}, {Manage sessions} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 383537b270e..98ed0545454 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -173,7 +173,7 @@ To open a project that is located in a particular directory, you can pass on the directory name as a command-line argument. \QC looks for - a \l{Managing Sessions}{session} that matches the directory name and + a \l{Manage sessions}{session} that matches the directory name and loads it. Or it looks for a project file in the directory and opens it. For example, on Windows: diff --git a/doc/qtcreator/src/howto/creator-sessions.qdoc b/doc/qtcreator/src/howto/creator-sessions.qdoc index 1201810e09f..348bea2139a 100644 --- a/doc/qtcreator/src/howto/creator-sessions.qdoc +++ b/doc/qtcreator/src/howto/creator-sessions.qdoc @@ -13,11 +13,13 @@ \previouspage creator-project-managing-workspaces.html \nextpage creator-keyboard-shortcuts.html \else - \previouspage creator-sharing-project-settings.html - \nextpage creator-design-mode.html + \previouspage creator-how-tos.html \endif - \title Managing Sessions + \ingroup creator-how-to-use + \ingroup studio-how-to + + \title Manage sessions When you exit \QC, it stores a snapshot of your current workspace as a \e session. To restore the session automatically when you start \QC, @@ -61,6 +63,8 @@ To save a session under a new name, select \uicontrol Clone. + \section1 Create new sessions + To create a new session: \list 1 @@ -76,9 +80,12 @@ \endlist + \section1 Open sessions + To switch between sessions, select \uicontrol {Open}. \if defined(qtcreator) + The \uicontrol Projects tab in the \uicontrol Welcome mode lists existing sessions. To open a session, select it or press \key Ctrl+Alt+, where \e is the number of the session to @@ -96,7 +103,7 @@ When you start \QC from the command line, you can give the name of a session as an argument and \QC will start with this session. - For more information, see \l{Command-Line Options}. + \sa {Command-Line Options}, {Searching with the Locator} \endif */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc index ce94263b593..f7f9eae3e8d 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc @@ -16,10 +16,6 @@ \image front-projects.png - You can share projects with other designers and developers across different - development platforms with a common tool for design, development, and - debugging. - \list \li \l{Creating Projects} @@ -42,14 +38,8 @@ configurations for \QC and your projects. You can modify the settings in the \uicontrol Projects mode. - \li \l{Managing Sessions} - - Sessions store items such as open files, breakpoints, and evaluated - expressions, which you do not typically want to share across - platforms. - \endlist - \sa {Build Systems} - + \sa {Manage Projects}{How To: Manage Projects}, {Manage sessions}, + {Build Systems} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc index 0fb7729d887..9bfe2dc2451 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc @@ -46,6 +46,6 @@ \note You cannot use this view to specify subprojects for projects. - \sa {Add subprojects to projects}, {Managing Sessions} + \sa {Add subprojects to projects}, {Manage sessions} */ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index ad60462b0f4..e5d2bd3e5f7 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -42,7 +42,6 @@ \li \l{Using Custom Output Parsers} \li \l{Sharing Project Settings} \endlist - \li \l{Managing Sessions} \endlist \li \l{Designing User Interfaces} \list diff --git a/doc/qtcreator/src/qtcreator.qdoc b/doc/qtcreator/src/qtcreator.qdoc index 7ae66a39ea1..346dc2802fe 100644 --- a/doc/qtcreator/src/qtcreator.qdoc +++ b/doc/qtcreator/src/qtcreator.qdoc @@ -53,7 +53,6 @@ \li \l{Creating Projects} \li \l{Version Control Systems} \li \l{Configuring Projects} - \li \l{Managing Sessions} \endlist \li \b {\l{Designing User Interfaces}} \list diff --git a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc index 4c1e9e9c54d..286cefa30b8 100644 --- a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc @@ -19,7 +19,7 @@ \if defined(qtcreator) The project tree has a list of all projects open in the current - \l{Managing Sessions}{session}. For each project, the tree visualizes + \l{Manage sessions}{session}. For each project, the tree visualizes the build system structure of the project and lists all files that are part of the project. diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index 20b6df7c41c..de4e993b7f6 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -36,7 +36,7 @@ \li \l{Qt Insight} \endlist \li \l{Managing Workspaces} - \li \l{Managing Sessions} + \li \l{Manage sessions} \li \l{Keyboard Shortcuts} \endlist \li \l{Creating Projects} From 35f8f069addf21a4e122c8a7cf8a0e9f5caa905f Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 13 Nov 2023 10:53:43 +0100 Subject: [PATCH 08/19] Doc: Fix "the the" Change-Id: Ib39bc4dddc75a10dedff6006283d1258415d679b Reviewed-by: Eike Ziller --- .../src/projects/creator-only/creator-projects-libraries.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc index 9d03ea4e892..89376e6a513 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc @@ -111,7 +111,7 @@ You can add a library into a \e subdirs project. Use wizards to create the project and the library and to link the library against the project. - \note This tutorial only applies when you select qmake as the the build + \note This tutorial only applies when you select qmake as the build system for the subdirs project. \section1 Creating a shared library From 218f346fcc76f56bb383b3717aef2e6b741e4e91 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 10 Nov 2023 15:28:32 +0100 Subject: [PATCH 09/19] Utils: Prevent temporary duplicated display of InfoBar items The delayed deletion of InfoBar items can cause short lived but visible duplication of InfoBar entries. This change hides the obsoloete items immediately to prevent that effect. Fixes: QTCREATORBUG-29877 Change-Id: I6ed428185849f22f8d87f68cf1a5fac610e9dddf Reviewed-by: Eike Ziller --- src/libs/utils/infobar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/utils/infobar.cpp b/src/libs/utils/infobar.cpp index 37daa486def..bd6429a7622 100644 --- a/src/libs/utils/infobar.cpp +++ b/src/libs/utils/infobar.cpp @@ -268,6 +268,7 @@ void InfoBarDisplay::update() { for (QWidget *widget : std::as_const(m_infoWidgets)) { widget->disconnect(this); // We want no destroyed() signal now + widget->hide(); // Late deletion can cause duplicate infos. Hide immediately to prevent it. widget->deleteLater(); } m_infoWidgets.clear(); From 223deb596839e3b96236d0047c9e5290aedcb691 Mon Sep 17 00:00:00 2001 From: Xavier BESSON Date: Mon, 13 Nov 2023 09:40:37 +0100 Subject: [PATCH 10/19] Shortcut to enable/disable shortcuts routing to terminal Fixes: QTCREATORBUG-29876 Change-Id: I8b04c09ce1de7dab968499773179f663c1c6fe7d Reviewed-by: Marcus Tillmanns --- src/plugins/terminal/terminalconstants.h | 1 + src/plugins/terminal/terminalpane.cpp | 8 ++++++++ src/plugins/terminal/terminalpane.h | 1 + src/plugins/terminal/terminalwidget.cpp | 6 ++++++ 4 files changed, 16 insertions(+) diff --git a/src/plugins/terminal/terminalconstants.h b/src/plugins/terminal/terminalconstants.h index 99700475e60..67b618c62de 100644 --- a/src/plugins/terminal/terminalconstants.h +++ b/src/plugins/terminal/terminalconstants.h @@ -15,5 +15,6 @@ constexpr char CLEARSELECTION[] = "Terminal.ClearSelection"; constexpr char MOVECURSORWORDLEFT[] = "Terminal.MoveCursorWordLeft"; constexpr char MOVECURSORWORDRIGHT[] = "Terminal.MoveCursorWordRight"; constexpr char CLEAR_TERMINAL[] = "Terminal.ClearTerminal"; +constexpr char TOGGLE_KEYBOARD_LOCK[] = "Terminal.ToggleKeyboardLock"; } // namespace Terminal::Constants diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index a11284ef1bd..cdbbb850173 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -125,6 +125,8 @@ TerminalPane::TerminalPane(QObject *parent) updateLockButton(); + connect(&toggleKeyboardLock, &QAction::triggered, m_lockKeyboardButton, &QToolButton::toggle); + connect(m_lockKeyboardButton, &QToolButton::toggled, this, [this, updateLockButton] { settings().lockKeyboard.setValue(m_lockKeyboardButton->isChecked()); updateLockButton(); @@ -292,6 +294,8 @@ void TerminalPane::initActions() closeTerminal.setIcon(CLOSE_TERMINAL_ICON.icon()); closeTerminal.setToolTip(Tr::tr("Close the current Terminal.")); + toggleKeyboardLock.setText(Tr::tr("Toggle Keyboard Lock")); + using namespace Constants; Command *cmd = ActionManager::registerAction(&newTerminal, NEWTERMINAL, m_selfContext); @@ -310,6 +314,10 @@ void TerminalPane::initActions() QKeySequence(HostOsInfo::isMacHost() ? QLatin1String("Ctrl+Shift+]") : QLatin1String("Ctrl+PgDown"))}); + ActionManager::registerAction(&toggleKeyboardLock, + TOGGLE_KEYBOARD_LOCK, + m_selfContext); + connect(&newTerminal, &QAction::triggered, this, [this] { openTerminal({}); }); connect(&closeTerminal, &QAction::triggered, this, [this] { removeTab(m_tabWidget.currentIndex()); diff --git a/src/plugins/terminal/terminalpane.h b/src/plugins/terminal/terminalpane.h index c21d1525120..dc3b4d30f15 100644 --- a/src/plugins/terminal/terminalpane.h +++ b/src/plugins/terminal/terminalpane.h @@ -66,6 +66,7 @@ private: QAction nextTerminal; QAction prevTerminal; QAction closeTerminal; + QAction toggleKeyboardLock; QMenu m_shellMenu; diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index c9b52f6bf35..584a15a90cd 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -571,6 +571,12 @@ bool TerminalWidget::event(QEvent *event) return true; } + if (settings().lockKeyboard() + && QKeySequence(keyEvent->keyCombination()) + == ActionManager::command(Constants::TOGGLE_KEYBOARD_LOCK)->keySequence()) { + return false; + } + if (settings().lockKeyboard()) { event->accept(); return true; From 45858f739a20bf2dcc859cd5aac80766e991a875 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 14 Nov 2023 08:49:25 +0100 Subject: [PATCH 11/19] McuSupport: Fix building tests Change-Id: I9473805663ea2d33ddf600ae06c455b139bac89b Reviewed-by: hjk --- src/plugins/mcusupport/test/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/mcusupport/test/CMakeLists.txt b/src/plugins/mcusupport/test/CMakeLists.txt index 7d2a94c286e..dc1e00a0942 100644 --- a/src/plugins/mcusupport/test/CMakeLists.txt +++ b/src/plugins/mcusupport/test/CMakeLists.txt @@ -1,6 +1,7 @@ extend_qtc_plugin(McuSupport CONDITION WITH_TESTS AND TARGET Googletest DEPENDS Googletest + DEFINES GOOGLE_TEST_IS_FOUND SOURCES unittest.h unittest.cpp packagemock.h From 8290a7636ecfb802488f8e336ab7e8b741a959a9 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 13 Nov 2023 09:14:51 +0100 Subject: [PATCH 12/19] ProjectExplorer: Really don't create replacment kits for Design Studio Amends b5dec80d6b6. Change-Id: I34b263626c66dfec2676ff311d1f5e460333b924 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/project.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 20c65655627..c0e245baf1c 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -821,7 +821,11 @@ void Project::createTargetFromMap(const Store &map, int index) } Kit *k = KitManager::kit(id); - if (!k && !ICore::isQtDesignStudio()) { + if (!k) { + // QDS does not want replacement kits. + if (ICore::isQtDesignStudio()) + return; + Id deviceTypeId = Id::fromSetting(targetMap.value(Target::deviceTypeKey())); if (!deviceTypeId.isValid()) deviceTypeId = Constants::DESKTOP_DEVICE_TYPE; From 74a089f3eaf0df437f0603a96f4eb386e1730552 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 13 Nov 2023 13:33:50 +0100 Subject: [PATCH 13/19] CppEditor: Fix the lookUpDefinition() function ... that tells us whether we need to offer the "add #include" quickfix. If we encounter a forward declaration, we cannot return yet, as a proper declaration might still show up. Fixes: QTCREATORBUG-29883 Change-Id: Ie1b831b9414043c3fc0d5d1e914b6096957757e6 Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/cppeditor/cppquickfixes.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 012785df349..7c460a0ad73 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -1953,25 +1953,30 @@ LookupResult lookUpDefinition(const CppQuickFixInterface &interface, const NameA // Try to find the class/template definition const Name *name = nameAst->name; const QList results = interface.context().lookup(name, scope); + LookupResult best = LookupResult::NotDeclared; for (const LookupItem &item : results) { if (Symbol *declaration = item.declaration()) { if (declaration->asClass()) return LookupResult::Declared; - if (declaration->asForwardClassDeclaration()) - return LookupResult::ForwardDeclared; + if (declaration->asForwardClassDeclaration()) { + best = LookupResult::ForwardDeclared; + continue; + } if (Template *templ = declaration->asTemplate()) { if (Symbol *declaration = templ->declaration()) { if (declaration->asClass()) return LookupResult::Declared; - if (declaration->asForwardClassDeclaration()) - return LookupResult::ForwardDeclared; + if (declaration->asForwardClassDeclaration()) { + best = LookupResult::ForwardDeclared; + continue; + } } } return LookupResult::Declared; } } - return LookupResult::NotDeclared; + return best; } QString templateNameAsString(const TemplateNameId *templateName) From 3ef343bbf8273f2447b7cc50a10ae07f090e2acf Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 9 Nov 2023 12:41:00 +0100 Subject: [PATCH 14/19] Core: Improve readability of searchresult error messages Task-number: QTCREATORBUG-29824 Change-Id: Ic26a6671b886d74ab2aac1d8e1baa66bd9fe7f8d Reviewed-by: Eike Ziller --- src/plugins/coreplugin/find/searchresultwidget.cpp | 8 ++++---- src/plugins/coreplugin/find/searchresultwidget.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/find/searchresultwidget.cpp b/src/plugins/coreplugin/find/searchresultwidget.cpp index 06c59d95ecc..400f8e06370 100644 --- a/src/plugins/coreplugin/find/searchresultwidget.cpp +++ b/src/plugins/coreplugin/find/searchresultwidget.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -93,8 +94,6 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) : topLayout->addWidget(m_topReplaceWidget); m_messageWidget = new QFrame; - pal.setColor(QPalette::WindowText, creatorTheme()->color(Theme::TextColorError)); - m_messageWidget->setPalette(pal); if (creatorTheme()->flag(Theme::DrawSearchResultWidgetFrame)) { m_messageWidget->setFrameStyle(QFrame::Panel | QFrame::Raised); m_messageWidget->setLineWidth(1); @@ -103,8 +102,9 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) : auto messageLayout = new QHBoxLayout(m_messageWidget); messageLayout->setContentsMargins(2, 2, 2, 2); m_messageWidget->setLayout(messageLayout); - m_messageLabel = new QLabel; - m_messageLabel->setPalette(pal); + m_messageLabel = new InfoLabel; + m_messageLabel->setType(InfoLabel::Error); + m_messageLabel->setFilled(true); messageLayout->addWidget(m_messageLabel); layout->addWidget(m_messageWidget); m_messageWidget->setVisible(false); diff --git a/src/plugins/coreplugin/find/searchresultwidget.h b/src/plugins/coreplugin/find/searchresultwidget.h index a9f87c467f1..4a40346343a 100644 --- a/src/plugins/coreplugin/find/searchresultwidget.h +++ b/src/plugins/coreplugin/find/searchresultwidget.h @@ -18,6 +18,7 @@ class QToolButton; class QCheckBox; QT_END_NAMESPACE +namespace Utils { class InfoLabel; } namespace Core { namespace Internal { @@ -123,7 +124,7 @@ private: QWidget *m_descriptionContainer = nullptr; QLabel *m_label = nullptr; QLabel *m_searchTerm = nullptr; - QLabel *m_messageLabel = nullptr; + Utils::InfoLabel *m_messageLabel = nullptr; QToolButton *m_cancelButton = nullptr; QLabel *m_matchesFoundLabel = nullptr; bool m_preserveCaseSupported = true; From 206000a3d606135d3afa6509fb276d62be6e2b70 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 14 Nov 2023 11:29:44 +0100 Subject: [PATCH 15/19] Fix state of LineColumButton after clicking When using the `pressed` signal, the button stays in the "pressed" state forever afterwards. Using the `clicked` signal behaves correctly, so use that instead. Change-Id: I646c93f1db3b1176630f1cfa718aba01d0aaf252 Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 66efbcfda02..db85a570178 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -157,7 +157,7 @@ public: , m_editor(parent) { connect(m_editor, &QPlainTextEdit::cursorPositionChanged, this, &LineColumnButton::update); - connect(this, &QToolButton::pressed, ActionManager::instance(), [this] { + connect(this, &QToolButton::clicked, ActionManager::instance(), [this] { emit m_editor->activateEditor(EditorManager::IgnoreNavigationHistory); QMetaObject::invokeMethod(ActionManager::instance(), [] { if (Command *cmd = ActionManager::command(Core::Constants::GOTO)) { From 90e6fb54b6606bfa61d1679002887b4cb757fe37 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 14 Nov 2023 15:13:15 +0100 Subject: [PATCH 16/19] COIN: Update to Qt 6.6 provisioning That Qt version is used for building as well Change-Id: Idae06324532b0dc2f453b802ca3d817fe3d41593 Reviewed-by: Cristian Adam Reviewed-by: Qt CI Bot --- coin/product_dependencies.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin/product_dependencies.yaml b/coin/product_dependencies.yaml index 4212b9b2e24..a658f8103be 100644 --- a/coin/product_dependencies.yaml +++ b/coin/product_dependencies.yaml @@ -1,4 +1,4 @@ dependencies: ../../qt/qt5.git: - ref: "6.5" + ref: "6.6" From 7819fc5dfbf18025112bab0c9a7ea3acaae418ec Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Wed, 15 Nov 2023 14:53:48 +0100 Subject: [PATCH 17/19] Terminal: Only unlock exit on macOS Fixes: QTCREATORBUG-29902 Change-Id: Ifbb1f12c874f2f68483a34ac6e117214211e5be4 Reviewed-by: Eike Ziller --- src/plugins/terminal/terminalwidget.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 584a15a90cd..57fdea52a6d 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -293,7 +293,11 @@ void TerminalWidget::setupActions() this, &TerminalWidget::moveCursorWordRight); - unlockGlobalAction(Core::Constants::EXIT); + // Ctrl+Q, the default "Quit" shortcut, is a useful key combination in a shell. + // It can be used in combination with Ctrl+S to pause a program, and resume it with Ctrl+Q. + // So we unlock the EXIT command only for macOS where the default is Cmd+Q to quit. + if (HostOsInfo::isMacHost()) + unlockGlobalAction(Core::Constants::EXIT); unlockGlobalAction(Core::Constants::OPTIONS); unlockGlobalAction("Preferences.Terminal.General"); unlockGlobalAction(Core::Constants::FIND_IN_DOCUMENT); From b960fb448152c394c259a82237f602fef7c01a7c Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 16 Nov 2023 09:48:38 +0100 Subject: [PATCH 18/19] Editor: centrally emit filesChangedInternally after refactorings ...instead of relying on the surrounding code of the refactoring to emit the signal. This also ensures that the signal is only emitted for files that are not opened inside a TextEditor. Change-Id: I6223362864014c691962d895b864f9f44c36e035 Reviewed-by: Christian Kandeler --- src/plugins/clangcodemodel/clangdfindreferences.cpp | 4 +--- src/plugins/languageclient/languageclientsymbolsupport.cpp | 7 ------- src/plugins/texteditor/basefilefind.cpp | 1 - src/plugins/texteditor/refactoringchanges.cpp | 6 +++--- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/plugins/clangcodemodel/clangdfindreferences.cpp b/src/plugins/clangcodemodel/clangdfindreferences.cpp index 19e1df4dd16..b7e62d6e055 100644 --- a/src/plugins/clangcodemodel/clangdfindreferences.cpp +++ b/src/plugins/clangcodemodel/clangdfindreferences.cpp @@ -252,10 +252,8 @@ void ClangdFindReferences::Private::handleRenameRequest( { const Utils::FilePaths filePaths = BaseFileFind::replaceAll(newSymbolName, checkedItems, preserveCase); - if (!filePaths.isEmpty()) { - DocumentManager::notifyFilesChangedInternally(filePaths); + if (!filePaths.isEmpty()) SearchResultWindow::instance()->hide(); - } const auto renameFilesCheckBox = qobject_cast(search->additionalReplaceWidget()); QTC_ASSERT(renameFilesCheckBox, return); diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 2631a853996..4f93e537f70 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -691,13 +691,10 @@ void SymbolSupport::handleRenameResponse(Core::SearchResult *search, void SymbolSupport::applyRename(const Utils::SearchResultItems &checkedItems, Core::SearchResult *search) { - QSet affectedNonOpenFilePaths; QMap> editsForDocuments; QList changes; for (const Utils::SearchResultItem &item : checkedItems) { const auto filePath = Utils::FilePath::fromUserInput(item.path().value(0)); - if (!m_client->documentForFilePath(filePath)) - affectedNonOpenFilePaths << filePath; const QJsonObject jsonObject = item.userData().toJsonObject(); if (const TextEdit edit(jsonObject); edit.isValid()) editsForDocuments[filePath] << edit; @@ -715,10 +712,6 @@ void SymbolSupport::applyRename(const Utils::SearchResultItems &checkedItems, for (auto it = editsForDocuments.begin(), end = editsForDocuments.end(); it != end; ++it) applyTextEdits(m_client, it.key(), it.value()); - if (!affectedNonOpenFilePaths.isEmpty()) { - Core::DocumentManager::notifyFilesChangedInternally(Utils::toList(affectedNonOpenFilePaths)); - } - const auto extraWidget = qobject_cast(search->additionalReplaceWidget()); QTC_ASSERT(extraWidget, return); if (!extraWidget->shouldRenameFiles()) diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 4bda6757745..8ddadeb7c7e 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -388,7 +388,6 @@ void BaseFileFind::doReplace(const QString &text, const SearchResultItems &items if (!files.isEmpty()) { FadingIndicator::showText(ICore::dialogParent(), Tr::tr("%n occurrences replaced.", nullptr, items.size()), FadingIndicator::SmallText); - DocumentManager::notifyFilesChangedInternally(files); SearchResultWindow::instance()->hide(); } } diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index 1398d55bcaa..e49d6ff75fc 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -355,9 +355,9 @@ bool RefactoringFile::apply() QString error; // suppress "file has changed" warnings if the file is open in a read-only editor Core::FileChangeBlocker block(m_filePath); - if (!m_textFileFormat.writeFile(m_filePath, - doc->toPlainText(), - &error)) { + if (m_textFileFormat.writeFile(m_filePath, doc->toPlainText(), &error)) { + Core::DocumentManager::notifyFilesChangedInternally({m_filePath}); + } else { qWarning() << "Could not apply changes to" << m_filePath << ". Error: " << error; result = false; From 5e0c97a38e84d1cd23f4dcae5bc50352619b9502 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 16 Nov 2023 13:50:51 +0100 Subject: [PATCH 19/19] LanguageClient: fix restarting language servers A timer is used to ensure a server shuts down after a certain amount of time. This timer needs to be reset after restarting the client otherwise the client gets forcefully deleted after the timeout. Change-Id: I804678ec9491328e3da11fd0f9faa59f6e5f7d92 Reviewed-by: Christian Kandeler --- src/plugins/languageclient/client.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index def0016f3ab..5a1fcc44668 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1661,6 +1661,7 @@ void Client::setLogTarget(LogTarget target) void Client::start() { + d->m_shutdownTimer.stop(); LanguageClientManager::addClient(this); d->m_clientInterface->start(); }