diff --git a/dist/changelog/changes-11.0.0.md b/dist/changelog/changes-11.0.0.md index a637950a445..ebfc6584875 100644 --- a/dist/changelog/changes-11.0.0.md +++ b/dist/changelog/changes-11.0.0.md @@ -118,7 +118,7 @@ Editing * Fixed that generated functions did not have a `const` qualifier when required ([QTCREATORBUG-29274](https://bugreports.qt.io/browse/QTCREATORBUG-29274)) -* Fixed that locator showed both the declaration and the definition of symbols +* Fixed that the locator showed both the declaration and the definition of symbols ([QTCREATORBUG-13894](https://bugreports.qt.io/browse/QTCREATORBUG-13894)) * Fixed the handling of C++20 keywords and concepts * Clangd @@ -154,8 +154,9 @@ Editing ### Python -* Added the option to create a virtual environment (`venv`) to the Python - interpreter selector and the wizard +* Added the `Create Virtual Environment` option to the Python interpreter + selector on the editor toolbar and to the wizards in `File > New Project > + > Application (Qt for Python)` ([PYSIDE-2152](https://bugreports.qt.io/browse/PYSIDE-2152)) * Fixed that too many progress indicators could be created ([QTCREATORBUG-29224](https://bugreports.qt.io/browse/QTCREATORBUG-29224)) @@ -167,10 +168,11 @@ Projects * Made it possible to add devices in `Preferences > Devices > Add` without going through the wizard + ([Documentation](https://doc.qt.io/qtcreator/creator-developing-b2qt.html)) + ([Documentation](https://doc.qt.io/qtcreator/creator-developing-generic-linux.html)) * Added support for moving files to a different directory when renaming them in the `File System` view ([QTCREATORBUG-15981](https://bugreports.qt.io/browse/QTCREATORBUG-15981)) - ([Documentation](https://doc.qt.io/qtcreator/creator-file-system-view.html)) ### CMake @@ -184,10 +186,13 @@ Projects [QTCREATORBUG-28904](https://bugreports.qt.io/browse/QTCREATORBUG-28904), [QTCREATORBUG-28985](https://bugreports.qt.io/browse/QTCREATORBUG-28985), [QTCREATORBUG-29006](https://bugreports.qt.io/browse/QTCREATORBUG-29006)) + ([Documentation](https://doc.qt.io/qtcreator/creator-project-cmake.html)) * Added `Build > Reload CMake Presets` to reload CMake presets after making changes to them -* Added support for `block()` and `endblock()` -* Fixed that CMake Presets were not visible in `Projects` view + ([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-build-settings-cmake-presets.html)) +* Added support for the `block()` and `endblock()` CMake commands + ([CMake documentation](https://cmake.org/cmake/help/latest/command/block.html#command:block)) +* Fixed that CMake Presets were not visible in the `Projects` view ([QTCREATORBUG-28966](https://bugreports.qt.io/browse/QTCREATORBUG-28966)) * Fixed issues with detecting a configured Qt version when importing a build ([QTCREATORBUG-29075](https://bugreports.qt.io/browse/QTCREATORBUG-29075)) @@ -196,6 +201,7 @@ Projects * Added an option for selecting the interpreter to the wizards in `File > New Project > Application (Qt for Python)` + ([Documentation](https://doc.qt.io/qtcreator/creator-project-creating.html)) Debugging --------- @@ -203,6 +209,7 @@ Debugging * Improved the UI for enabling and disabling debuggers in `Projects > Run > Debugger settings` ([QTCREATORBUG-28627](https://bugreports.qt.io/browse/QTCREATORBUG-28627)) + ([Documentation](https://doc.qt.io/qtcreator/creator-debugging-qml.html)) * Fixed the automatic source mapping for Qt versions from an installer ([QTCREATORBUG-28950](https://bugreports.qt.io/browse/QTCREATORBUG-28950)) * Fixed pretty printer for `std::string` for recent `libc++` @@ -210,8 +217,8 @@ Debugging ### C++ -* Added an option for the default number of array elements to show - (`Preferences > Debugger > Locals & Expressions > Default array size`) +* Added the `Default array size` option for setting the default number of array + elements to show in `Preferences > Debugger > Locals & Expressions` * Fixed debugging in a terminal as the root user ([QTCREATORBUG-27519](https://bugreports.qt.io/browse/QTCREATORBUG-27519)) * CDB @@ -225,11 +232,12 @@ Debugging ### Qt Quick -* Improved the auto-detection if QML debugging is required +* Improved the auto-detection of whether QML debugging is required ([QTCREATORBUG-28627](https://bugreports.qt.io/browse/QTCREATORBUG-28627)) -* Added an option for disabling static analyzer messages to - `Qt Quick > QML/JS Editing` +* Added the `Use customized static analyzer` option for disabling static analyzer + messages to `Preferences > Qt Quick > QML/JS Editing` ([QTCREATORBUG-29095](https://bugreports.qt.io/browse/QTCREATORBUG-29095)) + ([Documentation](https://doc.qt.io/qtcreator/creator-checking-code-syntax.html)) Analyzer -------- diff --git a/doc/qtcreator/images/qtcreator-debugging-helper-options.png b/doc/qtcreator/images/qtcreator-debugging-helper-options.png deleted file mode 100644 index 43a106aed5c..00000000000 Binary files a/doc/qtcreator/images/qtcreator-debugging-helper-options.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-debugging-helper-options.webp b/doc/qtcreator/images/qtcreator-debugging-helper-options.webp new file mode 100644 index 00000000000..b38964e08fe Binary files /dev/null and b/doc/qtcreator/images/qtcreator-debugging-helper-options.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-qtquick-qmljs-editing.webp b/doc/qtcreator/images/qtcreator-preferences-qtquick-qmljs-editing.webp new file mode 100644 index 00000000000..622c80a3883 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-preferences-qtquick-qmljs-editing.webp differ diff --git a/doc/qtcreator/images/qtcreator-qml-js-editing.webp b/doc/qtcreator/images/qtcreator-qml-js-editing.webp index ab9a9f48422..7e759cf2da6 100644 Binary files a/doc/qtcreator/images/qtcreator-qml-js-editing.webp and b/doc/qtcreator/images/qtcreator-qml-js-editing.webp differ diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 53daebd104f..391618cc698 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -842,6 +842,11 @@ extensions. It uses this deeper understanding to present objects of such classes in a useful way. + To change the number of array elements that are + requested when expanding entries, select \uicontrol Edit > + \uicontrol Preferences > \uicontrol {Debugger} > + \uicontrol {Locals & Expressions} > \uicontrol {Default array size}. + \section1 Stepping Through Code The following table summarizes the functions that you can use to step through @@ -984,7 +989,7 @@ > \uicontrol {Debugger} > \uicontrol {Locals & Expressions} > \uicontrol {Use Debugging Helpers}. - \image qtcreator-debugging-helper-options.png "Locals & Expressions preferences" + \image qtcreator-debugging-helper-options.webp {Locals & Expressions preferences} In the \uicontrol Locals view, expand the object's entry and open the slot in the \e slots subitem. The view shows the objects connected to this slot @@ -1365,7 +1370,7 @@ \uicontrol Debugger > \uicontrol GDB > \uicontrol {Load system GDB pretty printers}. For more information, see \l{Specifying GDB Settings}. - \image qtcreator-gdb-options.png "GDB preferences" + \image qtcreator-gdb-options.png {GDB preferences} \section2 Customizing Built-In Debugging Helpers @@ -1375,7 +1380,7 @@ \uicontrol Debugger > \uicontrol {Locals & Expressions}, and enter the commands in the \uicontrol {Debugging Helper Customization} field. - \image qtcreator-debugging-helper-options.png "Locals & Expressions preferences" + \image qtcreator-debugging-helper-options.webp {Locals & Expressions preferences} If you receive error messages about receiving signals when using GDB, you can specify \l{https://sourceware.org/gdb/onlinedocs/gdb/Signals.html} @@ -1586,7 +1591,7 @@ selecting \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > \uicontrol CDB > \uicontrol {Use Python dumper}. - \image qtcreator-cdb-options.png "CDB preferences" + \image qtcreator-cdb-options.png {CDB preferences} The following sections describe some of the widely-used Dumper classes and members specified in \c qtcreator\share\qtcreator\debugger\dumper.py. @@ -2036,7 +2041,7 @@ > \uicontrol Preferences > \uicontrol Debugger > \uicontrol GDB > \uicontrol {Use automatic symbol cache}. - \image qtcreator-gdb-options.png "GDB preferences" + \image qtcreator-gdb-options.png {GDB preferences} \section2 Minimizing Number of Breakpoints diff --git a/doc/qtcreator/src/docker/creator-docker.qdoc b/doc/qtcreator/src/docker/creator-docker.qdoc index c6b62b6dd83..33c358a5bed 100644 --- a/doc/qtcreator/src/docker/creator-docker.qdoc +++ b/doc/qtcreator/src/docker/creator-docker.qdoc @@ -16,15 +16,14 @@ While Linux, \macos, and Windows hosts are supported in principle, Linux is the recommended platform. - Currently, only CMake is supported for building applications in the Docker - container. - To build, run, and debug applications on Docker devices, you must install and configure \c docker-cli on the development host. \QC automatically detects \l{Adding Kits}{build and run kit} items, such \l{Adding Debuggers} {debuggers} and \l{Adding Qt Versions}{Qt versions}, in the Docker container and creates kits for the devices. + You can use CMake or qmake to build applications in the Docker container. + To pull images from Docker hub or other registries, use the \l{https://docs.docker.com/engine/reference/commandline/pull/}{docker pull} command. diff --git a/doc/qtcreator/src/editors/creator-code-syntax.qdoc b/doc/qtcreator/src/editors/creator-code-syntax.qdoc index 791bb4fc295..87203f8bd3a 100644 --- a/doc/qtcreator/src/editors/creator-code-syntax.qdoc +++ b/doc/qtcreator/src/editors/creator-code-syntax.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! @@ -699,6 +699,19 @@ \endtable + \section1 Enabling and Disabling Messages + + To enable and disable QML and JavaScript messages, select \uicontrol Edit > + \uicontrol Preferences > \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} + > \uicontrol {Use customized static analyzer}. + + \image qtcreator-preferences-qtquick-qmljs-editing.webp {QML/JS Editing tab in Qt Quick preferences} + + In \uicontrol Enabled, select the messages that you want to see. + To disable messages for non-Qt Quick UI files, select them in + \uicontrol {Disable messages for non Qt Quick UI}. You cannot + enable messages just for non-Qt Quick UI files. + \section1 Resetting the Code Model If you change the build and run kit when you have QML files open in the code diff --git a/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc b/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc index 80b7466214f..ca3b44304f7 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc @@ -70,14 +70,14 @@ \li When developing on Linux, the \key {Ctrl+Shift+U} keyboard shortcut might not work because it conflicts with a shortcut of the - Intelligent Input Bus (ibus). You can change the shortcut for finding - references to the symbol under the cursor either in \QC or in ibus. + Intelligent Input Bus (ibus). You can change either the shortcut in + \QC or the conflicting shortcut in ibus. To set another \l {Keyboard Shortcuts}{keyboard shortcut} in \QC, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Environment > \uicontrol Keyboard. - To change the shortcut in ibus, enter the following command on the + To change the ibus shortcut, enter the following command on the command line to start ibus setup: \badcode ibus-setup diff --git a/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc b/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc index ca76ac369b2..01706aa950e 100644 --- a/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc @@ -26,8 +26,8 @@ \image studio-live-preview.png \endif - To preview any QML file that belongs to the project, right-click the project - name in the \l Projects view, and select \uicontrol {Preview File}. + To preview any QML file that belongs to the project, right-click the + filename in the \l Projects view, and select \uicontrol {Preview File}. \if defined(qtdesignstudio) To preview the whole UI, select \uicontrol {Show Live Preview} diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 0d804a06043..b1d7ee3549a 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -755,15 +755,15 @@ class Dumper(DumperBase): qtVersionAndNamespace = None try: qtVersionAndNamespace = self.fetchQtVersionAndNamespace() - DumperBase.warn("Detected Qt Version: 0x%0x (namespace='%s')" % - (qtVersionAndNamespace[1], qtVersionAndNamespace[0] or "no namespace")) + self.report("Detected Qt Version: 0x%0x (namespace='%s')" % + (qtVersionAndNamespace[1], qtVersionAndNamespace[0] or "no namespace")) except Exception as e: DumperBase.warn('[lldb] Error detecting Qt version: %s' % e) try: self.fetchInternalFunctions() - DumperBase.warn('Found function QObject::property: 0x%0x' % self.qtPropertyFunc) - DumperBase.warn('Found function QObject::customEvent: 0x%0x' % self.qtCustomEventFunc) + self.report('Found function QObject::property: 0x%0x' % self.qtPropertyFunc) + self.report('Found function QObject::customEvent: 0x%0x' % self.qtCustomEventFunc) except Exception as e: DumperBase.warn('[lldb] Error fetching internal Qt functions: %s' % e) diff --git a/src/libs/solutions/tasking/CMakeLists.txt b/src/libs/solutions/tasking/CMakeLists.txt index 926343e9c8b..ae51b12a7bd 100644 --- a/src/libs/solutions/tasking/CMakeLists.txt +++ b/src/libs/solutions/tasking/CMakeLists.txt @@ -5,7 +5,7 @@ add_qtc_library(Tasking OBJECT SOURCES barrier.cpp barrier.h concurrentcall.h - networkquery.cpp + networkquery.cpp networkquery.h tasking_global.h tasktree.cpp tasktree.h EXPLICIT_MOC diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 2f52d694f3c..c50129aac25 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -263,15 +263,17 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa if (target->buildConfigurations().first()->buildType() != BuildConfiguration::BuildType::Release) m_extraAppParams = runControl->commandLine().arguments(); - if (auto aspect = runControl->aspect(Constants::ANDROID_AM_START_ARGS)) { - QTC_CHECK(aspect->value.typeId() == QVariant::String); - const QString startArgs = aspect->value.toString(); + if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_AM_START_ARGS); + !sd.values().isEmpty()) { + QTC_CHECK(sd.first().type() == QVariant::String); + const QString startArgs = sd.first().toString(); m_amStartExtraArgs = ProcessArgs::splitArgs(startArgs, OsTypeOtherUnix); } - if (auto aspect = runControl->aspect(Constants::ANDROID_PRESTARTSHELLCMDLIST)) { - QTC_CHECK(aspect->value.typeId() == QVariant::String); - const QStringList commands = aspect->value.toString().split('\n', Qt::SkipEmptyParts); + if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_PRESTARTSHELLCMDLIST); + !sd.values().isEmpty()) { + QTC_CHECK(sd.first().type() == QVariant::String); + const QStringList commands = sd.first().toString().split('\n', Qt::SkipEmptyParts); for (const QString &shellCmd : commands) m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd)); } @@ -279,9 +281,10 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa for (const QString &shellCmd : preStartCmdList.toStringList()) m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd)); - if (auto aspect = runControl->aspect(Constants::ANDROID_POSTFINISHSHELLCMDLIST)) { - QTC_CHECK(aspect->value.typeId() == QVariant::String); - const QStringList commands = aspect->value.toString().split('\n', Qt::SkipEmptyParts); + if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_POSTFINISHSHELLCMDLIST); + !sd.values().isEmpty()) { + QTC_CHECK(sd.first().type() == QVariant::String); + const QStringList commands = sd.first().toString().split('\n', Qt::SkipEmptyParts); for (const QString &shellCmd : commands) m_afterFinishAdbCommands.append(QString("shell %1").arg(shellCmd)); } diff --git a/src/plugins/autotest/testconfiguration.cpp b/src/plugins/autotest/testconfiguration.cpp index c095e9e0f6a..5f225db1972 100644 --- a/src/plugins/autotest/testconfiguration.cpp +++ b/src/plugins/autotest/testconfiguration.cpp @@ -57,9 +57,10 @@ FilePath ITestConfiguration::executableFilePath() const if (!hasExecutable()) return {}; - const Environment env = m_runnable.environment.hasChanges() - ? m_runnable.environment : Environment::systemEnvironment(); - return env.searchInPath(m_runnable.command.executable().path()); + const Environment env = m_runnable.environment.appliedToEnvironment( + m_runnable.command.executable().deviceEnvironment()); + + return m_runnable.command.executable().searchInDirectories(env.path()); } Environment ITestConfiguration::filteredEnvironment(const Environment &original) const diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 2ce4373b7f7..d5a3e6f202f 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -350,8 +350,8 @@ static RunSettings runSettings() return ClangToolsSettings::instance()->runSettings(); } -ClangTool::ClangTool(const QString &name, Utils::Id id) - : m_name(name), m_perspective{id.toString(), name} +ClangTool::ClangTool(const QString &name, Utils::Id id, ClangToolType type) + : m_name(name), m_perspective{id.toString(), name}, m_type(type) { setObjectName(name); m_diagnosticModel = new ClangToolsDiagnosticModel(this); @@ -830,8 +830,7 @@ static bool canAnalyzeProject(Project *project) struct CheckResult { enum { - InvalidTidyExecutable, - InvalidClazyExecutable, + InvalidExecutable, ProjectNotOpen, ProjectNotSuitable, ReadyToAnalyze, @@ -839,20 +838,13 @@ struct CheckResult { QString errorText; }; -static CheckResult canAnalyze() +static CheckResult canAnalyze(ClangToolType type, const QString &name) { const ClangDiagnosticConfig config = diagnosticConfig(runSettings().diagnosticConfigId()); - if (toolEnabled(ClangToolType::Tidy, config, runSettings()) - && !toolExecutable(ClangToolType::Tidy).isExecutableFile()) { - return {CheckResult::InvalidTidyExecutable, - Tr::tr("Set a valid Clang-Tidy executable.")}; - } - - if (toolEnabled(ClangToolType::Clazy, config, runSettings()) - && !toolExecutable(ClangToolType::Clazy).isExecutableFile()) { - return {CheckResult::InvalidClazyExecutable, - Tr::tr("Set a valid Clazy-Standalone executable.")}; + if (toolEnabled(type, config, runSettings()) + && !toolExecutable(type).isExecutableFile()) { + return {CheckResult::InvalidExecutable, Tr::tr("Set a valid %1 executable.").arg(name)}; } if (Project *project = ProjectManager::startupProject()) { @@ -876,10 +868,9 @@ void ClangTool::updateForInitialState() m_infoBarWidget->reset(); - const CheckResult result = canAnalyze(); + const CheckResult result = canAnalyze(m_type, m_name); switch (result.kind) - case CheckResult::InvalidTidyExecutable: { - case CheckResult::InvalidClazyExecutable: + case CheckResult::InvalidExecutable: { m_infoBarWidget->setError(InfoBarWidget::Warning, makeLink(result.errorText), [] { ICore::showOptionsDialog(Constants::SETTINGS_PAGE_ID); }); break; @@ -1084,7 +1075,7 @@ void ClangTool::updateForCurrentState() QString startActionToolTip = m_startAction->text(); QString startOnCurrentToolTip = m_startOnCurrentFileAction->text(); if (!isRunning) { - const CheckResult result = canAnalyze(); + const CheckResult result = canAnalyze(m_type, m_name); canStart = result.kind == CheckResult::ReadyToAnalyze; if (!canStart) { startActionToolTip = result.errorText; @@ -1171,11 +1162,12 @@ void ClangTool::updateForCurrentState() m_infoBarWidget->setDiagText(diagText); } -ClangTidyTool::ClangTidyTool() : ClangTool(Tr::tr("Clang-Tidy"), "ClangTidy.Perspective") +ClangTidyTool::ClangTidyTool() : ClangTool(Tr::tr("Clang-Tidy"), "ClangTidy.Perspective", + ClangToolType::Tidy) { m_instance = this; } -ClazyTool::ClazyTool() : ClangTool(Tr::tr("Clazy"), "Clazy.Perspective") +ClazyTool::ClazyTool() : ClangTool(Tr::tr("Clazy"), "Clazy.Perspective", ClangToolType::Clazy) { m_instance = this; } diff --git a/src/plugins/clangtools/clangtool.h b/src/plugins/clangtools/clangtool.h index fad280a17f1..87497e87066 100644 --- a/src/plugins/clangtools/clangtool.h +++ b/src/plugins/clangtools/clangtool.h @@ -82,7 +82,7 @@ signals: void finished(const QString &errorText); // For testing. protected: - ClangTool(const QString &name, Utils::Id id); + ClangTool(const QString &name, Utils::Id id, CppEditor::ClangToolType type); private: enum class State { @@ -154,6 +154,7 @@ private: QAction *m_expandCollapse = nullptr; Utils::Perspective m_perspective; + const CppEditor::ClangToolType m_type; }; class ClangTidyTool : public ClangTool diff --git a/src/plugins/clangtools/clangtoolrunner.cpp b/src/plugins/clangtools/clangtoolrunner.cpp index 666f07963b2..ecace1c7d36 100644 --- a/src/plugins/clangtools/clangtoolrunner.cpp +++ b/src/plugins/clangtools/clangtoolrunner.cpp @@ -218,11 +218,11 @@ GroupItem clangToolTask(const AnalyzeInputData &input, }; const Group group { + finishAllAndDone, Storage(storage), onGroupSetup(onSetup), Group { sequential, - finishAllAndDone, ProcessTask(onProcessSetup, onProcessDone, onProcessError), AsyncTask>(onReadSetup, onReadDone, onReadError) } diff --git a/src/plugins/clangtools/diagnosticmark.cpp b/src/plugins/clangtools/diagnosticmark.cpp index bc92e1d17e3..3802ee325cf 100644 --- a/src/plugins/clangtools/diagnosticmark.cpp +++ b/src/plugins/clangtools/diagnosticmark.cpp @@ -15,6 +15,7 @@ #include using namespace TextEditor; +using namespace Utils; namespace ClangTools { namespace Internal { @@ -22,37 +23,35 @@ namespace Internal { DiagnosticMark::DiagnosticMark(const Diagnostic &diagnostic, TextDocument *document) : TextMark(document, diagnostic.location.line, - {Tr::tr("Clang Tools"), Utils::Id(Constants::DIAGNOSTIC_MARK_ID)}) + {Tr::tr("Clang Tools"), Id(Constants::DIAGNOSTIC_MARK_ID)}) , m_diagnostic(diagnostic) { setSettingsPage(Constants::SETTINGS_PAGE_ID); - if (diagnostic.type == "error" || diagnostic.type == "fatal") - setColor(Utils::Theme::CodeModel_Error_TextMarkColor); - else - setColor(Utils::Theme::CodeModel_Warning_TextMarkColor); - setPriority(TextEditor::TextMark::HighPriority); + const bool isError = diagnostic.type == "error" || diagnostic.type == "fatal"; + setColor(isError ? Theme::CodeModel_Error_TextMarkColor : Theme::CodeModel_Warning_TextMarkColor); + setPriority(isError ? TextEditor::TextMark::HighPriority : TextEditor::TextMark::NormalPriority); QIcon markIcon = diagnostic.icon(); - setIcon(markIcon.isNull() ? Utils::Icons::CODEMODEL_WARNING.icon() : markIcon); + setIcon(markIcon.isNull() ? Icons::CODEMODEL_WARNING.icon() : markIcon); setToolTip(createDiagnosticToolTipString(diagnostic, std::nullopt, true)); setLineAnnotation(diagnostic.description); setActionsProvider([diagnostic] { // Copy to clipboard action QList actions; QAction *action = new QAction(); - action->setIcon(QIcon::fromTheme("edit-copy", Utils::Icons::COPY.icon())); + action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon())); action->setToolTip(Tr::tr("Copy to Clipboard")); QObject::connect(action, &QAction::triggered, [diagnostic] { const QString text = createFullLocationString(diagnostic.location) + ": " + diagnostic.description; - Utils::setClipboardAndSelection(text); + setClipboardAndSelection(text); }); actions << action; // Disable diagnostic action action = new QAction(); - action->setIcon(Utils::Icons::BROKEN.icon()); + action->setIcon(Icons::BROKEN.icon()); action->setToolTip(Tr::tr("Disable Diagnostic")); QObject::connect(action, &QAction::triggered, [diagnostic] { disableChecks({diagnostic}); }); actions << action; @@ -70,10 +69,10 @@ void DiagnosticMark::disable() return; m_enabled = false; if (m_diagnostic.type == "error" || m_diagnostic.type == "fatal") - setIcon(Utils::Icons::CODEMODEL_DISABLED_ERROR.icon()); + setIcon(Icons::CODEMODEL_DISABLED_ERROR.icon()); else - setIcon(Utils::Icons::CODEMODEL_DISABLED_WARNING.icon()); - setColor(Utils::Theme::Color::IconsDisabledColor); + setIcon(Icons::CODEMODEL_DISABLED_WARNING.icon()); + setColor(Theme::Color::IconsDisabledColor); } bool DiagnosticMark::enabled() const diff --git a/src/plugins/copilot/copilotoptionspage.cpp b/src/plugins/copilot/copilotoptionspage.cpp index 2b7374846fc..1d9a516d662 100644 --- a/src/plugins/copilot/copilotoptionspage.cpp +++ b/src/plugins/copilot/copilotoptionspage.cpp @@ -27,9 +27,22 @@ public: { using namespace Layouting; + auto warningLabel = new QLabel; + warningLabel->setWordWrap(true); + warningLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse + | Qt::LinksAccessibleByKeyboard + | Qt::TextSelectableByMouse); + warningLabel->setText(Tr::tr( + "Enabling %1 is subject to your agreement and abidance with your applicable " + "%1 terms. It is your responsibility to know and accept the requirements and " + "parameters of using tools like %1. This may include, but is not limited to, " + "ensuring you have the rights to allow %1 access to your code, as well as " + "understanding any implications of your use of %1 and suggestions produced " + "(like copyright, accuracy, etc.)." ).arg("Copilot")); + auto authWidget = new AuthWidget(); - QLabel *helpLabel = new QLabel(); + auto helpLabel = new QLabel(); helpLabel->setTextFormat(Qt::MarkdownText); helpLabel->setWordWrap(true); helpLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse @@ -52,8 +65,10 @@ public: .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/copilot/dist)")); Column { - authWidget, br, + QString("" + Tr::tr("Note:") + ""), br, + warningLabel, br, CopilotSettings::instance().enableCopilot, br, + authWidget, br, CopilotSettings::instance().nodeJsPath, br, CopilotSettings::instance().distPath, br, CopilotSettings::instance().autoComplete, br, diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index b8567f2feb4..5bdd3a54c3f 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -20,7 +20,7 @@ static void initEnableAspect(BoolAspect &enableCopilot) enableCopilot.setDisplayName(Tr::tr("Enable Copilot")); enableCopilot.setLabelText(Tr::tr("Enable Copilot")); enableCopilot.setToolTip(Tr::tr("Enables the Copilot integration.")); - enableCopilot.setDefaultValue(true); + enableCopilot.setDefaultValue(false); } CopilotSettings &CopilotSettings::instance() @@ -52,6 +52,7 @@ CopilotSettings::CopilotSettings() nodeJsPath.setLabelText(Tr::tr("Node.js path:")); nodeJsPath.setHistoryCompleter("Copilot.NodePath.History"); nodeJsPath.setDisplayName(Tr::tr("Node.js Path")); + nodeJsPath.setEnabler(&enableCopilot); nodeJsPath.setToolTip( Tr::tr("Select path to node.js executable. See https://nodejs.org/en/download/" "for installation instructions.")); @@ -62,6 +63,7 @@ CopilotSettings::CopilotSettings() distPath.setLabelText(Tr::tr("Path to agent.js:")); distPath.setHistoryCompleter("Copilot.DistPath.History"); distPath.setDisplayName(Tr::tr("Agent.js path")); + distPath.setEnabler(&enableCopilot); distPath.setToolTip(Tr::tr( "Select path to agent.js in Copilot Neovim plugin. See " "https://github.com/github/copilot.vim#getting-started for installation instructions.")); @@ -70,6 +72,7 @@ CopilotSettings::CopilotSettings() autoComplete.setSettingsKey("Copilot.Autocomplete"); autoComplete.setLabelText(Tr::tr("Request completions automatically")); autoComplete.setDefaultValue(true); + autoComplete.setEnabler(&enableCopilot); autoComplete.setToolTip(Tr::tr("Automatically request suggestions for the current text cursor " "position after changes to the document.")); diff --git a/src/plugins/cppeditor/doxygengenerator.cpp b/src/plugins/cppeditor/doxygengenerator.cpp index 3d88ddd0f55..5a57fdc3a3f 100644 --- a/src/plugins/cppeditor/doxygengenerator.cpp +++ b/src/plugins/cppeditor/doxygengenerator.cpp @@ -61,7 +61,7 @@ QString DoxygenGenerator::generate(QTextCursor cursor, const QString &text = block.text(); const Tokens &tks = lexer(text); for (const Token &tk : tks) { - if (tk.is(T_SEMICOLON) || tk.is(T_LBRACE)) { + if (tk.is(T_SEMICOLON)) { // No need to continue beyond this, we might already have something meaningful. cursor.setPosition(block.position() + tk.utf16charsEnd(), QTextCursor::KeepAnchor); break; @@ -74,6 +74,11 @@ QString DoxygenGenerator::generate(QTextCursor cursor, block = block.next(); } + // For the edge case of no semicolons at all, which can e.g. happen if the file + // consists only of empty function definitions. + if (!cursor.hasSelection()) + cursor.setPosition(cursor.document()->characterCount() - 1, QTextCursor::KeepAnchor); + if (!cursor.hasSelection()) return QString(); diff --git a/src/plugins/mcusupport/mcusupport.qbs b/src/plugins/mcusupport/mcusupport.qbs index c9b09f81eda..ca9f0eb4db4 100644 --- a/src/plugins/mcusupport/mcusupport.qbs +++ b/src/plugins/mcusupport/mcusupport.qbs @@ -13,6 +13,7 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "Debugger" } Depends { name: "CMakeProjectManager" } + Depends { name: "QmlJS" } Depends { name: "QtSupport" } Depends { name: "qtc_gtest_gmock"; condition: qtc.testsEnabled; required: false } diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp index 6d3e5f20c4f..d140a468e34 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp @@ -87,6 +87,9 @@ void MesonBuildSystem::parsingCompleted(bool success) UNLOCK(false); emitBuildSystemUpdated(); } + emitParsingFinished(success); + + emit buildConfiguration()->enabledChanged(); // HACK. Should not be needed. } ProjectExplorer::Kit *MesonBuildSystem::MesonBuildSystem::kit() diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 4012fbd6690..f69ab0afc8f 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1107,7 +1107,7 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, FilePaths compilerPaths; - if (!device.isNull()) { + if (device && device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { // FIXME: Merge with block below FilePaths searchPaths = detector.searchPaths; if (searchPaths.isEmpty()) diff --git a/src/plugins/texteditor/textmark.cpp b/src/plugins/texteditor/textmark.cpp index 6f30ac233ba..b817541b019 100644 --- a/src/plugins/texteditor/textmark.cpp +++ b/src/plugins/texteditor/textmark.cpp @@ -138,6 +138,8 @@ void TextMark::paintAnnotation(QPainter &painter, painter.fontMetrics(), fadeInOffset, fadeOutOffset); + if (m_staticAnnotationText.text() != rects.text) + m_staticAnnotationText.setText(rects.text); annotationRect->setRight(rects.fadeOutRect.right()); const QRectF eventRectF(eventRect); if (!(rects.fadeInRect.intersects(eventRectF) || rects.annotationRect.intersects(eventRectF) @@ -161,7 +163,7 @@ void TextMark::paintAnnotation(QPainter &painter, painter.fillRect(rects.annotationRect, colors.rectColor); painter.setPen(colors.textColor); paintIcon(&painter, rects.iconRect.toAlignedRect()); - painter.drawText(rects.textRect, Qt::AlignLeft, rects.text); + painter.drawStaticText(rects.textRect.topLeft(), m_staticAnnotationText); if (rects.fadeOutRect.isValid()) { grad = QLinearGradient(rects.fadeOutRect.topLeft() - contentOffset, rects.fadeOutRect.topRight() - contentOffset); diff --git a/src/plugins/texteditor/textmark.h b/src/plugins/texteditor/textmark.h index 7603dae5d6d..b04e98ba5c3 100644 --- a/src/plugins/texteditor/textmark.h +++ b/src/plugins/texteditor/textmark.h @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -139,6 +140,7 @@ private: bool m_visible = false; TextMarkCategory m_category; QString m_lineAnnotation; + mutable QStaticText m_staticAnnotationText; QString m_toolTip; std::function m_toolTipProvider; QString m_defaultToolTip; diff --git a/src/shared/qbs b/src/shared/qbs index f8335f02f26..1af935aec68 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit f8335f02f263d69d81d2557c0c4f87b7148cbe9d +Subproject commit 1af935aec680a3e2df3919807f631a6ee2c21e35