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/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/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" 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-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 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} 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 diff --git a/src/libs/nanotrace/CMakeLists.txt b/src/libs/nanotrace/CMakeLists.txt index 725210dcdec..c504a112e37 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 nanotraceglobals.h 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/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(); 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/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)); 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; 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, 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..7c460a0ad73 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 @@ -1950,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) @@ -9610,7 +9618,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 +9688,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; 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(); } 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/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 diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 03856f80369..d75f21dd767 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; diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index a4243932c7b..8f2b2d22187 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -32,8 +32,6 @@ add_feature_info("Model tracing" ${ENABLE_MODEL_TRACING} "") 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 @@ -83,8 +81,6 @@ add_qtc_library(QmlDesignerCore STATIC TextEditor Sqlite DEFINES - QMLDESIGNERCORE_LIBRARY - QMLDESIGNERUTILS_LIBRARY $<$:QDS_USE_PROJECTSTORAGE> INCLUDES ${CMAKE_CURRENT_LIST_DIR} @@ -490,7 +486,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 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..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); @@ -571,6 +575,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; 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; diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 7723fc0bc41..572fb64dece 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)) { 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()