diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 5cbd9cd4bf4..c27d24b43a1 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -330,7 +330,7 @@ function(add_qtc_plugin target_name) cmake_parse_arguments(_arg "SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT;SKIP_PCH" "VERSION;COMPAT_VERSION;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT;PLUGIN_CLASS" - "CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;SYSTEM_INCLUDES;PUBLIC_INCLUDES;PUBLIC_SYSTEM_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PLUGIN_TEST_DEPENDS;PROPERTIES" + "CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;SYSTEM_INCLUDES;PUBLIC_INCLUDES;PUBLIC_SYSTEM_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PLUGIN_TEST_DEPENDS;PLUGIN_MANUAL_DEPENDS;PROPERTIES" ${ARGN} ) @@ -421,6 +421,21 @@ function(add_qtc_plugin target_name) " { \"Name\" : \"${i}\", \"Version\" : \"${_v}\", \"Type\" : \"test\" }" ) endforeach(i) + list(LENGTH _arg_PLUGIN_MANUAL_DEPENDS manualdep_len) + math(EXPR manualdep_maxindex "${manualdep_len}-1") + if(manualdep_len GREATER 0) + # three items per entry: name, version, typeofdependency + foreach (i RANGE 0 ${manualdep_maxindex} 3) + math(EXPR dep_version_i "${i} + 1") + math(EXPR dep_type_i "${i} + 2") + list(GET _arg_PLUGIN_MANUAL_DEPENDS ${i} dep_name) + list(GET _arg_PLUGIN_MANUAL_DEPENDS ${dep_version_i} dep_version) + list(GET _arg_PLUGIN_MANUAL_DEPENDS ${dep_type_i} dep_type) + string(APPEND _arg_DEPENDENCY_STRING + " { \"Name\" : \"${dep_name}\", \"Version\" : \"${dep_version}\", \"Type\" : \"${dep_type}\" }" + ) + endforeach() + endif() string(REPLACE "} {" "},\n {" _arg_DEPENDENCY_STRING "${_arg_DEPENDENCY_STRING}" diff --git a/dist/changelog/changes-13.0.0.md b/dist/changelog/changes-13.0.0.md index 163b25914cb..70f91721719 100644 --- a/dist/changelog/changes-13.0.0.md +++ b/dist/changelog/changes-13.0.0.md @@ -21,7 +21,7 @@ Adds support for Qt 6 based applications with CMake for creating, building, deploying, running, and debugging for devices that use the [Qt Application Manager](https://doc.qt.io/QtApplicationManager/). -([Documentation](https://doc.qt.io/qtcreator/creator-overview-qtasam.html)) +([Documentation](https://doc-snapshots.qt.io/qtcreator-13.0/creator-how-to-run-in-app-manager.html)) General ------- diff --git a/doc/qtcreator/images/qtcreator-appman-deploy-settings.webp b/doc/qtcreator/images/qtcreator-appman-deploy-settings.webp new file mode 100644 index 00000000000..cf3b2dc5287 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-appman-deploy-settings.webp differ diff --git a/doc/qtcreator/images/qtcreator-appman-kit-selector.webp b/doc/qtcreator/images/qtcreator-appman-kit-selector.webp new file mode 100644 index 00000000000..ee8521f9c41 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-appman-kit-selector.webp differ diff --git a/doc/qtcreator/images/qtcreator-appman-run-settings.webp b/doc/qtcreator/images/qtcreator-appman-run-settings.webp new file mode 100644 index 00000000000..1afc5bdd26b Binary files /dev/null and b/doc/qtcreator/images/qtcreator-appman-run-settings.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-texteditor-macros.webp b/doc/qtcreator/images/qtcreator-preferences-texteditor-macros.webp new file mode 100644 index 00000000000..f8c7347f45d Binary files /dev/null and b/doc/qtcreator/images/qtcreator-preferences-texteditor-macros.webp differ diff --git a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc index 07dd1128a17..77bc417d03a 100644 --- a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc +++ b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc @@ -505,4 +505,6 @@ The \l {Application Output} view shows some information even if the Performance Analyzer displays error messages. + + \sa {Profiling Function Execution} */ diff --git a/doc/qtcreator/src/analyze/creator-valgrind.qdoc b/doc/qtcreator/src/analyze/creator-valgrind.qdoc index 537f1acfea6..47d4b8c1d6c 100644 --- a/doc/qtcreator/src/analyze/creator-valgrind.qdoc +++ b/doc/qtcreator/src/analyze/creator-valgrind.qdoc @@ -323,7 +323,7 @@ \endlist - \sa {Detach views} + \sa {Analyzing CPU Usage}, {Detach views} */ /*! diff --git a/doc/qtcreator/src/appman/creator-appman-how-to-run.qdoc b/doc/qtcreator/src/appman/creator-appman-how-to-run.qdoc new file mode 100644 index 00000000000..a6319a7f2ad --- /dev/null +++ b/doc/qtcreator/src/appman/creator-appman-how-to-run.qdoc @@ -0,0 +1,154 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-run-in-app-manager.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-run + + \title Run in Qt Application Manager + + If you have set up \l{Qt Application Manager}, you can deploy, run, and + debug applications on the desktop, remote generic SSH Linux targets, or + \l{Boot2Qt}{Boot2Qt devices}. The applications can be either + \e {built-in applications} or \e {third-party applications}. The former + are part of the System UI or the base installation, while the latter + are dynamically installed, updated, and uninstalled. + + \note Enable the experimental Application Manager plugin to use it. + + To build a Qt Application Manager project, deploy it, and run selected apps + in the System UI: + + \list 1 + \li Open an application manager project. + \li In \uicontrol Projects > \uicontrol {Build & Run}, select a kit that + specifies the Qt version and the device to use. + \li Go to \preferences > \uicontrol Devices and specify a connection to + the device. + \li In \uicontrol Projects > \uicontrol {Build & Run}, specify settings + for deploying and running the application with the selected kit. + \li In the kit selector, select \inlineimage icons/run_small.png for the + run target. + \endlist + + You can see command-line output in the \l {Application Output} view. You + can start, stop, and debug applications from there. + + On Linux, running a multi-process application starts a new process that you + can stop. If the application uses a runtime of the type \c qml-inprocess, or + you are running on Windows or \macos, you cannot debug it as an individual + process. However, you can debug it as a part of the System UI. + + Debugging works transparently if you set it up for the run target. + + \section1 Application manager CMake functions + + Since Qt 6.7, when using CMake as the build system, use the following + functions in the CMakeLists.txt file to indicate, which applications + to create as built-in packages and which to create as installable packages: + + \list + \li \l {qt6_am_create_builtin_package} + \li \l {qt6_am_create_installable_package} + \endlist + + \section1 Customize the installation + + To change the settings for deploying and running the application with the + selected kit, go to \uicontrol Projects and select \uicontrol {Build & Run} + > \uicontrol Run. + + \image qtcreator-appman-deploy-settings.webp {Deploy to application manager} + + \section2 Automatic deployment configuration selection + + In an application manager project, the targets need different deployment + mechanisms. The System UI is deployed with the \e {default deployment + configuration}, while all application manager packages use an + \e {automatic application manager deploy configuration}, which deploys only + the package itself when an installable package should be started. + + The appropriate deployment configuration is automatically selected when the + current run configuration changes. + + \section2 Deployment configuration + + In \uicontrol Method, \uicontrol {Automatic Application Manager + Deploy Configuration} adds the necessary CMake and tool arguments, as well as + \uicontrol Targets to the effective \uicontrol Build command. You can select + the targets in the kit selector to deploy and run applications on them. + + \image qtcreator-appman-kit-selector.webp {Automatically generated run targets in the kit selector} + + \section2 Installation settings + + In \uicontrol {Install Application Manager Package}, you can customize the + \c {install-package} command. + + \QC uses the compiler from the kit (toolchain) to build the application. + Then, it installs the application package into the target system using the + \uicontrol Controller executable that must be running on the target. It + is delivered with Qt Application Manager. + + In \uicontrol {Command line arguments}, the \c --acknowledge argument + automatically acknowledges the installation. If the System UI implemented + a confirmation dialog, you can remove this flag to show the dialog to the + user when installing the package. + + To install some other package, select \uicontrol {Customize step}, and + then enter the path to the package file in \uicontrol {Package file}. + + \section1 Application manager run settings + + To specify settings for running applications, go to \uicontrol Projects > + \uicontrol {Run Settings}. + + \image qtcreator-appman-run-settings.webp {Run in Qt Application Manager} + + The following table summarizes the run settings for each application. + + \table + \header + \li Setting + \li Value + \row + \li \uicontrol {Controller} + \li The path to the controller that installs the application package into + the target system. + + When you run applications on a Boot2Qt device, you can see the device + ID here. + \row + \li \uicontrol {Application ID} + \li The ID of the \c ApplicationManager application. + \row + \li \uicontrol {Document URL} + \li The URL is passed to the started application, which can use it to + start an action, such as opening the passed file URL. + \row + \li \uicontrol {Application Manager instance ID} + \li The name of this application manager instance. Only useful if you are + running multiple instances at the same time and you need to address + them from the controller. A unique number is appended to this ID to + disambiguate instances with the same ID. + + If you have several application manager instances running, you can + override the instance ID in the \c config.yaml file. + \row + \li \uicontrol {Default instance} + \li Always communicates with the default instance. + \endtable + + \section1 Profile Qt Quick applications + + You can use the \l{Profiling QML Applications}{QML Profiler} to find causes + for typical performance problems in your Qt Quick applications, such as + slowness and unresponsive, stuttering user interfaces. You cannot profile an + in-process runtime as an individual process. + + \sa {Activate kits for a project}, {Connecting Boot2Qt Devices}, + {Connecting Remote Linux Devices}, {Enable and disable plugins}, + {Run on many platforms}, {Debugging}, {Profiling QML Applications} +*/ diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc index 0bf54dde2fb..c71a8bed8cc 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc @@ -145,8 +145,8 @@ To view all variables, select the \uicontrol Advanced check box. - To view all variables by default, select \preferences > \uicontrol CMake > - \uicontrol General > \uicontrol {Show advanced options by default}. + To view all variables by default, go to \preferences > \uicontrol CMake > + \uicontrol General and select \uicontrol {Show advanced options by default}. \image qtcreator-preferences-cmake-general.webp "General tab in CMake Preferences" @@ -159,8 +159,8 @@ stored in the CMakeLists.txt.user file, so deleting a build directory does not delete the initial configuration. - To be asked before \QC resets the changes, select \preferences > - \uicontrol CMake > \uicontrol General > + To be asked before \QC resets the changes, go to \preferences > + \uicontrol CMake > \uicontrol General and select \uicontrol {Ask before re-configuring with initial parameters}. \section1 Viewing CMake Output @@ -268,16 +268,20 @@ \uicontrol Build > \uicontrol {Rebuild Project}. This cleans up the build directory and performs a new build. - \section1 Using CMake with Conan + \section1 Using CMake with Package Managers - \QC can automatically set up the \l {Conan Package Manager} for use with - CMake. + To automatically set up the \l {Conan Package Manager}{Conan} or + \l {vcpkg Package Manager}{vcpkg} package manager for use with CMake: - Select \preferences > \uicontrol CMake - \uicontrol General > \uicontrol {Package manager auto setup} to set the - value of the \c CMAKE_PROJECT_INCLUDE_BEFORE variable to the path to a - CMake script that installs dependencies from a \c conanfile.txt, - \c conanfile.py, or \c vcpkg.json file in the project source directory. + \list 1 + \li Create a CMake script file that installs dependencies from a + \c conanfile.txt, \c conanfile.py, or \c vcpkg.json file in + the project source directory. + \li Set the path to the script as the value of the + \c CMAKE_PROJECT_INCLUDE_BEFORE variable. + \li Go to \preferences > \uicontrol CMake > \uicontrol General and select + \uicontrol {Package manager auto setup}. + \endlist \section1 QTC_RUN Environment Variable diff --git a/doc/qtcreator/src/conan/creator-projects-conan.qdoc b/doc/qtcreator/src/conan/creator-projects-conan.qdoc index 0e1f60e664b..0e7229ba7c3 100644 --- a/doc/qtcreator/src/conan/creator-projects-conan.qdoc +++ b/doc/qtcreator/src/conan/creator-projects-conan.qdoc @@ -48,5 +48,5 @@ use with CMake. \sa {Conan Build Configuration}, {Enable and disable plugins}, - {Using CMake with Conan} + {Using CMake with Package Managers} */ diff --git a/doc/qtcreator/src/editors/creator-editors-options.qdoc b/doc/qtcreator/src/editors/creator-editors-options.qdoc index 152b89e6b15..fa1ee7df04c 100644 --- a/doc/qtcreator/src/editors/creator-editors-options.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options.qdoc @@ -49,11 +49,6 @@ \li Add, modify, and remove \l{Snippets}{code snippets} in \uicontrol Snippets. - \if defined(qtcreator) - \li View and remove \l{Using Text Editing Macros}{text editing macros} - in \uicontrol Macros. - \endif - \li Configure \l{Completion}{code completion} in \uicontrol Completion. \endlist diff --git a/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc b/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc index 5706b2d70dd..c0ca9294607 100644 --- a/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc @@ -65,16 +65,10 @@ colleagues to review a change that you plan to submit to a version control system. - \li \l{Using Text Editing Macros} - - When you have a file open in the code editor, you can record a - keyboard sequence as a macro. You can then play the macro to - repeat the sequence. You can save the latest macro and assign a - keyboard shortcut for running it or run it from the locator. \endif \endlist \if defined(qtcreator) - \sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Comparing Files} + \sa {Edit Code}{How To: Edit Code}, {Edit Mode} \endif */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc b/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc index 7e77b016b4c..a1dc27193c7 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc @@ -52,7 +52,7 @@ To paste any content that you copied to the clipboard, select \uicontrol Tools > \uicontrol {Code Pasting} > \uicontrol {Paste Snippet}. - To paste content from the \l{Comparing Files}{diff editor}, right-click a + To paste content from the \l{Compare files}{diff editor}, right-click a chunk and select \uicontrol {Send Chunk to CodePaster} in the context menu. To fetch a snippet of code from the server, select \uicontrol Tools > diff --git a/doc/qtcreator/src/editors/creator-diff-editor.qdoc b/doc/qtcreator/src/editors/creator-only/creator-diff-editor.qdoc similarity index 72% rename from doc/qtcreator/src/editors/creator-diff-editor.qdoc rename to doc/qtcreator/src/editors/creator-only/creator-diff-editor.qdoc index 8557cd8bffb..de83a3e1ab7 100644 --- a/doc/qtcreator/src/editors/creator-diff-editor.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-diff-editor.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2020 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -9,31 +9,31 @@ /*! \page creator-diff-editor.html - \if defined(qtdesignstudio) - \previouspage qt-quick-toolbars.html - \nextpage studio-finding.html - \else - \previouspage creator-macros.html - \nextpage creator-clang-codemodel.html - \endif + \previouspage creator-how-tos.html - \title Comparing Files + \ingroup creator-how-to-edit - You can use a diff editor to display unsaved changes in the current file or - all open files or to compare any two text files that can be either versions - of the same file or arbitrary files. + \title Compare files - To view unsaved changes in the current file, select \uicontrol Tools > + You can view unsaved changes in the current file or all open files, + as well as compare any two text files. They can be either versions of + the same file or arbitrary files. + + \section1 View unsaved changes + + To view unsaved changes in the current file, go to \uicontrol Tools > \uicontrol Diff > \uicontrol {Diff Current File}. - To view unsaved changes in all open files, select \uicontrol Tools > + To view unsaved changes in all open files, go to \uicontrol Tools > \uicontrol Diff > \uicontrol {Diff Open Files}. + \section1 Compare two files + To compare two files: \list 1 - \li Select \uicontrol Tools > \uicontrol Diff > + \li Go to \uicontrol Tools > \uicontrol Diff > \uicontrol {Diff External Files}. \li Select two files to compare. @@ -41,36 +41,32 @@ \endlist To compare the currently opened file against another file in a project - or the filesystem: + or the file system: \list 1 \li Open the first file in an editor. - \li Right click on the second file in the \uicontrol Projects + \li Right-click the second file in the \uicontrol Projects or \uicontrol {File System} view and select \uicontrol {Diff Against Current File}. \endlist If \QC cannot detect the encoding of the files to compare, an info bar - appears that displays the option to reload the document using some other + displays the option to reload the document using some other encoding. For more information, see \l {Change text encoding}. - \section1 Viewing the Changes + \section1 View changes - \image creator-diff-editor.png "Diff editor output in the Edit mode" + \image creator-diff-editor.png {Diff editor output in the Edit mode} - The changes are displayed in the \uicontrol Edit mode. Color coding is + View the changes in the \uicontrol Edit mode. Color coding is used to mark changed lines. By default, red indicates lines that contain removed text (painted another shade of red) in the left pane and green indicates lines that contain added text (painted another shade of green) in the right pane. - To revert the changes, right-click added text and then select - \uicontrol {Revert Chunk} in the context menu. To apply the changes, select - removed text and then select \uicontrol {Apply Chunk}. - To view the differences in a unified view where changed rows are placed below each other, select \inlineimage icons/unifieddiff.png (\uicontrol {Switch to Unified Diff Editor}). @@ -85,22 +81,34 @@ show in \uicontrol {Context lines}. By default, the horizontal scroll bars in the left and right pane are - synchronized. To use them independently of each other, select the + synchronized. To use them independently of each other, select \inlineimage icons/linkicon.png - (\uicontrol {Synchronize Horizontal Scroll Bars}) button. + (\uicontrol {Synchronize Horizontal Scroll Bars}). + + \section1 Revert and apply changes + + To revert the changes, right-click added text and then select + \uicontrol {Revert Chunk} in the context menu. + + To apply the changes, select removed text and then select + \uicontrol {Apply Chunk}. + + \section1 Reload files If the files change outside \QC, select \inlineimage icons/reload_gray.png (\uicontrol {Reload Editor}) to compare them again and to show the results. \if defined(qtcreator) + \section1 Paste changes for review + To send a chunk of changes to a \l{Pasting and Fetching Code Snippets} {code pasting service}, select \uicontrol {Send Chunk to CodePaster} in the context menu. \endif - \section1 Changing the Colors + \section1 Change colors - To change the default colors, select \preferences > + To change the default colors, go to \preferences > \uicontrol {Text Editor} > \uicontrol {Font & Colors}. Create your own color scheme and select new colors for the following items: diff --git a/doc/qtcreator/src/editors/creator-only/creator-text-editing-macros.qdoc b/doc/qtcreator/src/editors/creator-only/creator-text-editing-macros.qdoc index fd4b4a8b709..796931f3289 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-text-editing-macros.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-text-editing-macros.qdoc @@ -1,35 +1,61 @@ -// Copyright (C) 2023 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \previouspage creator-editor-codepasting.html \page creator-macros.html - \nextpage creator-diff-editor.html + \previouspage creator-how-tos.html - \title Using Text Editing Macros + \ingroup creator-how-to-edit - To record a text editing macro, select \uicontrol Tools > - \uicontrol {Text Editing Macros} > \uicontrol {Record Macro} - or press \key {Alt+[}. To stop recording, select \uicontrol Tools > - \uicontrol {Text Editing Macros} > \uicontrol {Stop Recording Macro} or - press \key {Alt+]}. + \title Record text editing macros + + When you have a file open in the code editor, you can record a + keyboard sequence as a macro. You can then play the macro to + repeat the sequence. You can save the latest macro and assign a + keyboard shortcut for running it or run it from the locator. + + \section1 Record macros + + To record a text editing macro: + + \list 1 + \li Go to \uicontrol Tools > \uicontrol {Text Editing Macros} > + \uicontrol {Record Macro} or press \key {Alt+[}. + \li Press keyboard keys. + \li To stop recording, go to \uicontrol Tools > + \uicontrol {Text Editing Macros} > \uicontrol {Stop Recording Macro} + or press \key {Alt+]}. + \endlist \note The macro recorder does not support code completion. - To play the last macro, select \uicontrol Tools > - \uicontrol {Text Editing Macros} > \uicontrol {Play Last Macro} or - press \key {Alt+R}. + \section1 Play macros - To save the last macro, select \uicontrol Tools > + To play the last macro: + + \list + \li Go to \uicontrol Tools > \uicontrol {Text Editing Macros} > + \uicontrol {Play Last Macro}. + \li Press \key {Alt+R}. + \li Enter \c rm in the locator. + \endlist + + \section1 Save macros + + To save the last macro, go to \uicontrol Tools > \uicontrol {Text Editing Macros} > \uicontrol {Save Last Macro}. - To assign a keyboard shortcut to a text editing macro, select - \preferences > \uicontrol Environment > - \uicontrol Keyboard. For more information, see \l{Assign keyboard shortcuts}. - - You can also use the \c rm locator filter to run a macro. For more - information, see \l{Navigate with locator}. - - To view and remove saved macros, select \preferences > + To view and remove saved macros, go to \preferences > \uicontrol {Text Editor} > \uicontrol Macros. + + \image qtcreator-preferences-texteditor-macros.webp {Macros tab in Text Editor Preferences} + + \section1 Assign keyboard shortcuts to macros + + To assign a keyboard shortcut to a text editing macro, go to + \preferences > \uicontrol Environment > \uicontrol Keyboard. + + \sa {Assign keyboard shortcuts}, {Edit Code}{How To: Edit Code}, + {Navigate with locator} */ diff --git a/doc/qtcreator/src/external-resources/external-resources.qdoc b/doc/qtcreator/src/external-resources/external-resources.qdoc index e3295245df2..89662ca1ca1 100644 --- a/doc/qtcreator/src/external-resources/external-resources.qdoc +++ b/doc/qtcreator/src/external-resources/external-resources.qdoc @@ -173,3 +173,11 @@ \externalpage https://developer.android.com/studio/install \title Android Studio Installation Guide */ +/*! + \externalpage https://doc-snapshots.qt.io/applicationmanager-dev/cmake-qt6-am-create-builtin-package.html + \title qt6_am_create_builtin_package +*/ +/*! + \externalpage https://doc-snapshots.qt.io/applicationmanager-dev/cmake-qt6-am-create-installable-package.html + \title qt6_am_create_installable_package +*/ diff --git a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc index b1cc26e9297..3f7499b5b5c 100644 --- a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc +++ b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc @@ -9,7 +9,8 @@ \title Connecting Boot2Qt Devices You can connect \l{Boot2Qt} devices to the development PC to run, debug, - and analyze applications built for them from \QC. + and analyze applications built for them from \QC. For this, you need the + appropriate \l{http://qt.io/licensing/}{Qt license}. If you have a tool chain for building applications for Boot2Qt devices installed on the development PC, you can add it to \QC. You can then diff --git a/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc b/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc index 14f642e38ba..261fad18125 100644 --- a/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc +++ b/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc @@ -60,8 +60,7 @@ \li \l{Connecting Boot2Qt Devices} \li \l{Boot2Qt Run Settings} \li \l{Deploying to Boot2Qt} - \li \l{https://doc.qt.io/qtcreator/creator-overview-qtasam.html} - {Qt Creator Plugin for Qt Application Manager} + \li \l{Run in Qt Application Manager} \endlist \section1 Remote Linux @@ -77,8 +76,7 @@ \li \l{Deploying to Remote Linux} \li \l{Remote Linux Run Settings} \li \l{Run on remote Linux devices} - \li \l{https://doc.qt.io/qtcreator/creator-overview-qtasam.html} - {Qt Creator Plugin for Qt Application Manager} + \li \l{Run in Qt Application Manager} \endlist \section1 Microcontroller Units (MCU) diff --git a/doc/qtcreator/src/overview/creator-only/creator-commercial-overview.qdoc b/doc/qtcreator/src/overview/creator-only/creator-commercial-overview.qdoc deleted file mode 100644 index f594ad49beb..00000000000 --- a/doc/qtcreator/src/overview/creator-only/creator-commercial-overview.qdoc +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -// ********************************************************************** -// NOTE: the sections are not ordered by their logical order to avoid -// reshuffling the file each time the index order changes (i.e., often). -// Run the fixnavi.pl script to adjust the links to the index order. -// ********************************************************************** - -/*! - \page creator-commercial-overview.html - - \title Commercial Features - - \commercial - - You can use the following \QC features if you have the appropriate - \l{http://qt.io/licensing/}{Qt license}: - - \list - \li \l{https://doc.qt.io/Boot2Qt/index.html}{Boot2Qt} - \li \l{https://doc.qt.io/qtcreator/creator-overview-qtasam.html} - {Qt Application Manager} integration - \endlist -*/ diff --git a/doc/qtcreator/src/overview/creator-only/creator-mobile-targets.qdoc b/doc/qtcreator/src/overview/creator-only/creator-mobile-targets.qdoc index cd64ccad70f..3c25ce4eab0 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-mobile-targets.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-mobile-targets.qdoc @@ -81,22 +81,5 @@ \endlist - \section1 Related Topics - - \list - - \li \l{Building Applications for the Web} - - You can use the experimental Qt WebAssembly plugin to build - applications in WebAssembly format, to deploy them, and to - run them in a web browser. - - \li \l{https://doc.qt.io/qtcreator/creator-overview-qtasam.html} - {Qt Creator Plugin for Qt Application Manager} - - You can use the experimental Qt Application Manager plugin - (commercial only) to deploy, run, and debug applications on the - local Linux PC, remote generic SSH Linux targets, or - \l{Boot2Qt}{Boot2Qt devices}. - \endlist + \sa {Building Applications for the Web}, {Run in Qt Application Manager} */ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index c38beb825d3..6e45a628343 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -33,8 +33,6 @@ \li \l{Checking Code Syntax} \li \l{Using Qt Quick Toolbars} \li \l{Pasting and Fetching Code Snippets} - \li \l{Using Text Editing Macros} - \li \l{Comparing Files} \endlist \li \l{Configuring the Editor} \li \l{Using GitHub Copilot} diff --git a/doc/qtcreator/src/qtcreator.qdoc b/doc/qtcreator/src/qtcreator.qdoc index ddc9b74cca6..6fa4967023f 100644 --- a/doc/qtcreator/src/qtcreator.qdoc +++ b/doc/qtcreator/src/qtcreator.qdoc @@ -25,12 +25,6 @@ to build applications in web format and run them in web browsers. - This manual also describes features that are only available if you have the - appropriate \l{http://qt.io/licensing/}{Qt license}. For more information, - see \l{Commercial Features}. - - - \table \row \li {4,1} \b {\l{All Topics}{Click Here for a List of All Topics}} diff --git a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc index 2363e10a56b..829a711138f 100644 --- a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc @@ -11,7 +11,7 @@ \page qt-quick-toolbars.html \if defined(qtdesignstudio) \previouspage creator-preferences-qtquick-code-style.html - \nextpage creator-diff-editor.html + \nextpage studio-finding.html \else \previouspage creator-completing-code.html \nextpage creator-editor-codepasting.html diff --git a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc index 06226006d58..24f3b38479c 100644 --- a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc @@ -83,8 +83,10 @@ new filename. \li Remove existing files. \li Create new folders. + \if defined(qtcreator) \li Compare the selected file with the currently open file in the diff - editor. For more information, see \l{Comparing Files}. + editor. For more information, see \l{Compare files}. + \endif \li Display the contents of a particular directory in the view. \li Collapse all open folders. \endlist diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc index d483e54ca9d..c0c8386911f 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc @@ -142,7 +142,7 @@ \image qtcreator-vcs-diff.png With Git, Mercurial, and Subversion, the diff is displayed side-by-side in - a \l{Comparing Files}{diff editor} by default. To use the inline diff view + a \l{Compare files}{diff editor} by default. To use the inline diff view instead, select the \uicontrol {Switch to Text Diff Editor} (1) option from the toolbar. In the inline diff view, you can use context menu commands to apply, revert, stage, and diff --git a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc index b9a785fa908..ea23e53443b 100644 --- a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc +++ b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc @@ -79,7 +79,7 @@ \image qtcreator-vcs-diff.png - The \l{Comparing Files}{diff editor} displays the diff side-by-side. To use + The diff editor displays the diff side-by-side. To use the unified diff view instead, select the \uicontrol {Switch to Unified Diff Editor} (1) option from the toolbar. In both views, you can use context menu commands to apply, revert, stage, @@ -638,6 +638,7 @@ visible only when you have merge conflicts to resolve. \if defined(qtcreator) - \sa {Set up version control systems}, {Version Control Systems} + \sa {Compare files}, {Set up version control systems}, + {Version Control Systems} \endif */ diff --git a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf index 86a948bd889..72b38940f7c 100644 --- a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf +++ b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf @@ -37,6 +37,7 @@ excludedirs += ../../qtcreator/examples/accelbubble \ ../../qtcreator/examples/transitions \ ../../qtcreator/src/analyze \ ../../qtcreator/src/android \ + ../../qtcreator/src/appman \ ../../qtcreator/src/baremetal \ ../../qtcreator/src/cmake \ ../../qtcreator/src/conan \ diff --git a/doc/qtdesignstudio/src/overviews/studio-finding.qdoc b/doc/qtdesignstudio/src/overviews/studio-finding.qdoc index ead5bc33af1..231efcef3eb 100644 --- a/doc/qtdesignstudio/src/overviews/studio-finding.qdoc +++ b/doc/qtdesignstudio/src/overviews/studio-finding.qdoc @@ -3,7 +3,7 @@ /*! \page studio-finding.html - \previouspage creator-diff-editor.html + \previouspage qt-quick-toolbars.html \nextpage creator-editor-finding.html \title Finding diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index fe5d342e47b..08fb9c0b48a 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -209,7 +209,6 @@ \li \l{Behavior} \li \l{Qt Quick Code Style} \li \l{Using Qt Quick Toolbars} - \li \l{Comparing Files} \endlist \li \l{Finding} \list diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 3fc4b0bf583..a9912b3575f 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -117,7 +117,6 @@ add_qtc_library(Utils passworddialog.cpp passworddialog.h pathchooser.cpp pathchooser.h pathlisteditor.cpp pathlisteditor.h - persistentcachestore.cpp persistentcachestore.h persistentsettings.cpp persistentsettings.h pointeralgorithm.h port.cpp port.h diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index cb885cc495a..2941cfec613 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -279,8 +279,12 @@ private: QTCREATOR_UTILS_EXPORT void createItem(Layouting::LayoutItem *item, const BaseAspect &aspect); QTCREATOR_UTILS_EXPORT void createItem(Layouting::LayoutItem *item, const BaseAspect *aspect); -template -class TypedAspect : public BaseAspect +template +class +#ifndef Q_OS_WIN + QTCREATOR_UTILS_EXPORT +#endif + TypedAspect : public BaseAspect { public: using valueType = ValueType; diff --git a/src/libs/utils/detailsbutton.cpp b/src/libs/utils/detailsbutton.cpp index 2fc7482d393..88c0ca273ea 100644 --- a/src/libs/utils/detailsbutton.cpp +++ b/src/libs/utils/detailsbutton.cpp @@ -78,7 +78,7 @@ DetailsButton::DetailsButton(QWidget *parent) QSize DetailsButton::sizeHint() const { - const QSize textSize = fontMetrics().size(Qt::TextSingleLine, text()); + const QSize textSize = fontMetrics().size(Qt::TextSingleLine | Qt::TextShowMnemonic, text()); return QSize(spacing + textSize.width() + spacing + 16 + spacing, spacing + fontMetrics().height() + spacing); } @@ -107,7 +107,7 @@ void DetailsButton::paintEvent(QPaintEvent *e) qDrawPlainRect(&p, rect(), outlineColor()); const QRect textRect(spacing + 3, 0, width(), height()); - p.drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text()); + p.drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, text()); if (creatorTheme()->flag(Theme::FlatProjectsMode) || HostOsInfo::isMacHost()) { const QRect iconRect(width() - spacing - 15, 0, 16, height()); icon().paint(&p, iconRect); diff --git a/src/libs/utils/persistentcachestore.cpp b/src/libs/utils/persistentcachestore.cpp deleted file mode 100644 index 0cac5f83cde..00000000000 --- a/src/libs/utils/persistentcachestore.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "persistentcachestore.h" - -#include "filepath.h" -#include "fileutils.h" - -#include -#include -#include - -namespace Utils { - -class PrivateGlobal -{ -public: - QMutex mutex; - QMap caches; -}; - -static expected_str cacheFolder() -{ - static const FilePath folder = FilePath::fromUserInput(QStandardPaths::writableLocation( - QStandardPaths::CacheLocation)) - / "CachedStores"; - static expected_str created = folder.ensureWritableDir(); - static expected_str result = created ? folder - : expected_str( - make_unexpected(created.error())); - - QTC_ASSERT_EXPECTED(result, return result); - return result; -} - -static PrivateGlobal &globals() -{ - static PrivateGlobal global; - return global; -} - -static expected_str filePathFromKey(const Key &cacheKey) -{ - static const expected_str folder = cacheFolder(); - if (!folder) - return folder; - - return (*folder / FileUtils::fileSystemFriendlyName(stringFromKey(cacheKey))).withSuffix(".json"); -} - -expected_str PersistentCacheStore::byKey(const Key &cacheKey) -{ - const expected_str path = filePathFromKey(cacheKey); - if (!path) - return make_unexpected(path.error()); - - QMutexLocker locker(&globals().mutex); - - auto it = globals().caches.find(cacheKey); - if (it != globals().caches.end()) - return it.value(); - - const expected_str contents = path->fileContents(); - if (!contents) - return make_unexpected(contents.error()); - - auto result = storeFromJson(*contents); - if (!result) - return result; - - if (result->value("__cache_key__").toString() != stringFromKey(cacheKey)) { - return make_unexpected(QString("Cache key mismatch: \"%1\" to \"%2\" in \"%3\".") - .arg(stringFromKey(cacheKey)) - .arg(result->value("__cache_key__").toString()) - .arg(path->toUserOutput())); - } - - return result; -} - -expected_str PersistentCacheStore::write(const Key &cacheKey, const Store &store) -{ - const expected_str path = filePathFromKey(cacheKey); - if (!path) - return make_unexpected(path.error()); - - QMutexLocker locker(&globals().mutex); - globals().caches.insert(cacheKey, store); - - // TODO: The writing of the store data could be done in a separate thread in the future. - Store storeCopy = store; - storeCopy.insert("__cache_key__", stringFromKey(cacheKey)); - storeCopy.insert("__last_modified__", QDateTime::currentDateTime().toString(Qt::ISODate)); - QByteArray json = jsonFromStore(storeCopy); - const expected_str result = path->writeFileContents(json); - if (!result) - return make_unexpected(result.error()); - return {}; -} - -expected_str PersistentCacheStore::clear(const Key &cacheKey) -{ - const expected_str path = filePathFromKey(cacheKey); - if (!path) - return make_unexpected(path.error()); - - QMutexLocker locker(&globals().mutex); - globals().caches.remove(cacheKey); - - if (!path->removeFile()) - return make_unexpected(QString("Failed to remove cache file.")); - return {}; -} - -} // namespace Utils diff --git a/src/libs/utils/persistentcachestore.h b/src/libs/utils/persistentcachestore.h deleted file mode 100644 index 0c40061d619..00000000000 --- a/src/libs/utils/persistentcachestore.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "utils_global.h" - -#include "expected.h" -#include "store.h" -#include "storekey.h" - -namespace Utils { - -class QTCREATOR_UTILS_EXPORT PersistentCacheStore -{ -public: - static expected_str byKey(const Key &cacheKey); - static expected_str write(const Key &cacheKey, const Store &store); - static expected_str clear(const Key &cacheKey); -}; - -} // namespace Utils diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp index 2ebc6b351d4..75974498d90 100644 --- a/src/libs/utils/qtcprocess.cpp +++ b/src/libs/utils/qtcprocess.cpp @@ -226,6 +226,7 @@ void DefaultImpl::start() if (m_setup.m_runAsRoot && !HostOsInfo::isWindowsHost()) { arguments.prepend(program); + arguments.prepend("-E"); arguments.prepend("-A"); program = "sudo"; } diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index 23beeb4b3ff..69b5e395565 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -856,11 +857,7 @@ QString StyleHelper::dpiSpecificImageFile(const QString &fileName) QString StyleHelper::imageFileWithResolution(const QString &fileName, int dpr) { - const QFileInfo fi(fileName); - return dpr == 1 ? fileName : - fi.path() + QLatin1Char('/') + fi.completeBaseName() - + QLatin1Char('@') + QString::number(dpr) - + QLatin1String("x.") + fi.suffix(); + return qt_findAtNxFile(fileName, dpr); } QList StyleHelper::availableImageResolutions(const QString &fileName) diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 6aff153d357..4b7caf4805e 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -222,8 +222,6 @@ QtcLibrary { "pathchooser.h", "pathlisteditor.cpp", "pathlisteditor.h", - "persistentcachestore.cpp", - "persistentcachestore.h", "persistentsettings.cpp", "persistentsettings.h", "pointeralgorithm.h", diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 29a9a791b66..24fa0875c47 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -49,6 +49,7 @@ using namespace Utils; namespace Android::Internal { static Q_LOGGING_CATEGORY(androidsettingswidget, "qtc.android.androidsettingswidget", QtWarningMsg); +constexpr int requiredJavaMajorVersion = 17; class SummaryWidget : public QWidget { @@ -221,7 +222,6 @@ static expected_str testJavaC(const FilePath &jdkPath) const QString javacCommand("javac"); const QString versionParameter("-version"); - constexpr int requiredMajorVersion = 17; const FilePath bin = jdkPath / "bin" / (javacCommand + QTC_HOST_EXE_SUFFIX); if (!bin.isExecutableFile()) @@ -254,9 +254,9 @@ static expected_str testJavaC(const FilePath &jdkPath) jdkVersion = QVersionNumber::fromString(stdOut.mid(outputPrefix.length()).split('\n').first()); - if (jdkVersion.isNull() || jdkVersion.majorVersion() != requiredMajorVersion) { + if (jdkVersion.isNull() || jdkVersion.majorVersion() != requiredJavaMajorVersion) { return make_unexpected(Tr::tr("Unsupported JDK version (needs to be %1): %2 (parsed: %3)") - .arg(requiredMajorVersion) + .arg(requiredJavaMajorVersion) .arg(stdOut) .arg(jdkVersion.toString())); } @@ -692,10 +692,10 @@ void AndroidSettingsWidget::openNDKDownloadUrl() void AndroidSettingsWidget::openOpenJDKDownloadUrl() { - if (HostOsInfo::isLinuxHost()) - QDesktopServices::openUrl(QUrl::fromUserInput("https://openjdk.java.net/install/")); - else - QDesktopServices::openUrl(QUrl::fromUserInput("https://adoptopenjdk.net/")); + const QString url = + QString::fromLatin1("https://adoptium.net/temurin/releases/?package=jdk&version=%1") + .arg(requiredJavaMajorVersion); + QDesktopServices::openUrl(QUrl::fromUserInput(url)); } void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent) diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index b6761197e07..d1c896205fe 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -349,6 +349,7 @@ IssuesWidget::IssuesWidget(QWidget *parent) m_issuesView->setFrameShape(QFrame::StyledPanel); // Bring back Qt default m_issuesView->setFrameShadow(QFrame::Sunken); // Bring back Qt default m_headerView = new IssueHeaderView(this); + m_headerView->setSectionsMovable(true); connect(m_headerView, &IssueHeaderView::sortTriggered, this, &IssuesWidget::onSearchParameterChanged); m_issuesView->setHeader(m_headerView); diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index a5431b6069d..f0f90d3f253 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -402,7 +402,7 @@ static Group fetchHtmlRecipe(const QUrl &url, const std::function typename DtoStorageType> static Group dtoRecipe(const Storage> &dtoStorage) { - const Storage storage; + const Storage> storage; const auto onNetworkQuerySetup = [dtoStorage](NetworkQuery &query) { QNetworkRequest request(dtoStorage->url); @@ -451,7 +451,7 @@ static Group dtoRecipe(const Storage> &dtoStorage) if constexpr (std::is_same_v) { // Suppress logging error on unauthorized dashboard fetch if (!dtoStorage->credential && error->type == "UnauthenticatedException") - return DoneResult::Error; + return DoneResult::Success; } errorString = Error(DashboardError(reply->url(), statusCode, @@ -473,11 +473,15 @@ static Group dtoRecipe(const Storage> &dtoStorage) }; const auto onDeserializeSetup = [storage](Async> &task) { + if (!*storage) + return SetupResult::StopWithSuccess; + const auto deserialize = [](QPromise> &promise, const QByteArray &input) { promise.addResult(DtoType::deserializeExpected(input)); }; task.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer()); - task.setConcurrentCallData(deserialize, *storage); + task.setConcurrentCallData(deserialize, **storage); + return SetupResult::Continue; }; const auto onDeserializeDone = [dtoStorage](const Async> &task, @@ -534,14 +538,21 @@ static Group authorizationRecipe() unauthorizedDashboardStorage->url = QUrl(settings().server.dashboard); return SetupResult::Continue; }; - const auto onUnauthorizedGroupDone = [unauthorizedDashboardStorage] { + const auto onUnauthorizedDashboard = [unauthorizedDashboardStorage] { if (unauthorizedDashboardStorage->dtoData) { - dd->m_serverAccess = ServerAccess::NoAuthorization; - dd->m_dashboardInfo = toDashboardInfo(*unauthorizedDashboardStorage); - } else { - dd->m_serverAccess = ServerAccess::WithAuthorization; + const Dto::DashboardInfoDto &dashboardInfo = *unauthorizedDashboardStorage->dtoData; + const QString &username = settings().server.username; + if (username.isEmpty() + || (dashboardInfo.username && *dashboardInfo.username == username)) { + dd->m_serverAccess = ServerAccess::NoAuthorization; + dd->m_dashboardInfo = toDashboardInfo(*unauthorizedDashboardStorage); + return; + } + MessageManager::writeFlashing(QString("Axivion: %1") + .arg(Tr::tr("Unauthenticated access failed (wrong user), " + "using authenticated access..."))); } - return DoneResult::Success; + dd->m_serverAccess = ServerAccess::WithAuthorization; }; const auto onCredentialLoopCondition = [](int) { @@ -649,7 +660,7 @@ static Group authorizationRecipe() unauthorizedDashboardStorage, onGroupSetup(onUnauthorizedGroupSetup), dtoRecipe(unauthorizedDashboardStorage), - onGroupDone(onUnauthorizedGroupDone) + Sync(onUnauthorizedDashboard) }, Group { LoopUntil(onCredentialLoopCondition), diff --git a/src/plugins/axivion/credentialquery.cpp b/src/plugins/axivion/credentialquery.cpp index 14aabc3958e..f183c083736 100644 --- a/src/plugins/axivion/credentialquery.cpp +++ b/src/plugins/axivion/credentialquery.cpp @@ -44,6 +44,7 @@ void CredentialQueryTaskAdapter::start() task()->m_errorString = job->errorString(); else if (reader && job->error() == NoError) task()->m_data = reader->binaryData(); + disconnect(job, &Job::finished, this, nullptr); emit done(toDoneResult(success)); m_guard.release()->deleteLater(); }); diff --git a/src/plugins/axivion/dynamiclistmodel.cpp b/src/plugins/axivion/dynamiclistmodel.cpp index 7c5262132b8..80419a32234 100644 --- a/src/plugins/axivion/dynamiclistmodel.cpp +++ b/src/plugins/axivion/dynamiclistmodel.cpp @@ -87,8 +87,13 @@ bool DynamicListModel::setData(const QModelIndex &index, const QVariant &value, QVariant DynamicListModel::headerData(int section, Qt::Orientation orientation, int role) const { - if (orientation == Qt::Horizontal && role == Qt::DisplayRole && section < m_header.size()) + if (orientation == Qt::Vertical || section < 0 || section >= m_header.size()) + return {}; + if (role == Qt::DisplayRole) return m_header.at(section); + if (role == Qt::TextAlignmentRole) + return int(Qt::AlignLeft | Qt::AlignVCenter); + return {}; } diff --git a/src/plugins/axivion/issueheaderview.cpp b/src/plugins/axivion/issueheaderview.cpp index a9dfd38b8df..3635568a5a8 100644 --- a/src/plugins/axivion/issueheaderview.cpp +++ b/src/plugins/axivion/issueheaderview.cpp @@ -144,7 +144,15 @@ void IssueHeaderView::paintSection(QPainter *painter, const QRect &rect, int log const int margin = style()->pixelMetric(QStyle::PM_HeaderGripMargin, nullptr, this); const QIcon icon = iconForSorted(logicalIndex == m_currentSortIndex ? m_currentSortOrder : SortOrder::None); const int offset = qMax((rect.height() - ICON_SIZE), 0) / 2; - const QRect iconRect(rect.left() + rect.width() - ICON_SIZE - margin, offset, ICON_SIZE, ICON_SIZE); + const int left = rect.left() + rect.width() - ICON_SIZE - margin; + const QRect iconRect(left, offset, ICON_SIZE, ICON_SIZE); + const QRect clearRect(left, 0, ICON_SIZE + margin, rect.height()); + painter->save(); + QStyleOptionHeader opt; + initStyleOption(&opt); + opt.rect = clearRect; + style()->drawControl(QStyle::CE_Header, &opt, painter, this); + painter->restore(); icon.paint(painter, iconRect); } diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index 9adf94cafc1..e9f49a5eeec 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -101,7 +101,7 @@ private: QWidget *m_editorWidget = nullptr; QScrollArea *m_editorScrollArea = nullptr; TextEditor::SnippetEditorWidget *m_preview = nullptr; - Core::IEditor *m_editor = nullptr; + std::unique_ptr m_editor; std::unique_ptr m_config; @@ -156,8 +156,7 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc updatePreview(); } -void ClangFormatConfigWidget::slotCodeStyleChanged( - TextEditor::ICodeStylePreferences *codeStyle) +void ClangFormatConfigWidget::slotCodeStyleChanged(TextEditor::ICodeStylePreferences *codeStyle) { if (!codeStyle) return; @@ -177,7 +176,7 @@ void ClangFormatConfigWidget::initEditor(TextEditor::ICodeStylePreferences *code Core::EditorFactories factories = Core::IEditorFactory::preferredEditorTypes( m_config->filePath()); Core::IEditorFactory *factory = factories.takeFirst(); - m_editor = factory->createEditor(); + m_editor.reset(factory->createEditor()); QString errorString; m_editor->document()->open(&errorString, m_config->filePath(), m_config->filePath()); @@ -186,7 +185,7 @@ void ClangFormatConfigWidget::initEditor(TextEditor::ICodeStylePreferences *code invokeMethodForLanguageClientManager("documentOpened", Q_ARG(Core::IDocument *, m_editor->document())); invokeMethodForLanguageClientManager("editorOpened", - Q_ARG(Core::IEditor *, m_editor)); + Q_ARG(Core::IEditor *, m_editor.get())); m_editorWidget = m_editor->widget(); m_editorWidget->setEnabled(!codeStyle->isReadOnly() && !codeStyle->isTemporarilyReadOnly() @@ -221,7 +220,7 @@ void ClangFormatConfigWidget::initEditor(TextEditor::ICodeStylePreferences *code QShortcut *completionSC = new QShortcut(QKeySequence("Ctrl+Space"), this); connect(completionSC, &QShortcut::activated, this, [this] { - if (auto *editor = qobject_cast(m_editor)) + if (auto *editor = qobject_cast(m_editor.get())) editor->editorWidget()->invokeAssist(TextEditor::Completion); }); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 8bffb72ebc9..855a76681bf 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -723,8 +724,14 @@ QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, if (!configurePreset.cmakeExecutable) { const CMakeTool *cmakeTool = CMakeToolManager::defaultCMakeTool(); - if (cmakeTool) + if (cmakeTool) { configurePreset.cmakeExecutable = cmakeTool->cmakeExecutable().toString(); + } else { + configurePreset.cmakeExecutable = QString(); + TaskHub::addTask( + BuildSystemTask(Task::TaskType::Error, Tr::tr(""))); + TaskHub::requestPopup(); + } } else { QString cmakeExecutable = configurePreset.cmakeExecutable.value(); CMakePresets::Macros::expand(configurePreset, env, projectDirectory(), cmakeExecutable); diff --git a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp index 697af9c75fb..7847777c6ba 100644 --- a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp +++ b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp @@ -115,7 +115,7 @@ public: CMakeTool cmake(m_autodetected ? CMakeTool::AutoDetection : CMakeTool::ManualDetection, m_id); cmake.setFilePath(m_executable); - m_isSupported = cmake.hasFileApi(true); + m_isSupported = cmake.hasFileApi(); m_tooltip = Tr::tr("Version: %1").arg(cmake.versionDisplay()); m_tooltip += "
" + Tr::tr("Supports fileApi: %1").arg(m_isSupported ? Tr::tr("yes") : Tr::tr("no")); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 6c06238dfdb..4cb638659a1 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -11,7 +11,6 @@ #include #include -#include #include #include #include @@ -155,13 +154,13 @@ FilePath CMakeTool::filePath() const return m_executable; } -bool CMakeTool::isValid(bool ignoreCache) const +bool CMakeTool::isValid() const { if (!m_id.isValid() || !m_introspection) return false; if (!m_introspection->m_didAttemptToRun) - readInformation(ignoreCache); + readInformation(); return m_introspection->m_haveCapabilitites && !m_introspection->m_fileApis.isEmpty(); } @@ -324,9 +323,9 @@ CMakeKeywords CMakeTool::keywords() return m_introspection->m_keywords; } -bool CMakeTool::hasFileApi(bool ignoreCache) const +bool CMakeTool::hasFileApi() const { - return isValid(ignoreCache) ? !m_introspection->m_fileApis.isEmpty() : false; + return isValid() ? !m_introspection->m_fileApis.isEmpty() : false; } CMakeTool::Version CMakeTool::version() const @@ -438,7 +437,7 @@ void CMakeTool::openCMakeHelpUrl(const CMakeTool *tool, const QString &linkUrl) Core::HelpManager::showHelpUrl(linkUrl.arg(documentationUrl(version, online))); } -void CMakeTool::readInformation(bool ignoreCache) const +void CMakeTool::readInformation() const { QTC_ASSERT(m_introspection, return ); if (!m_introspection->m_haveCapabilitites && m_introspection->m_didAttemptToRun) @@ -446,7 +445,7 @@ void CMakeTool::readInformation(bool ignoreCache) const m_introspection->m_didAttemptToRun = true; - fetchFromCapabilities(ignoreCache); + fetchFromCapabilities(); } @@ -625,17 +624,8 @@ QStringList CMakeTool::parseSyntaxHighlightingXml() return moduleFunctions; } -void CMakeTool::fetchFromCapabilities(bool ignoreCache) const +void CMakeTool::fetchFromCapabilities() const { - expected_str cache = PersistentCacheStore::byKey( - keyFromString("CMake_" + cmakeExecutable().toUserOutput())); - - if (cache && !ignoreCache) { - m_introspection->m_haveCapabilitites = true; - parseFromCapabilities(cache->value("CleanedStdOut").toString()); - return; - } - Process cmake; runCMake(cmake, {"-E", "capabilities"}); @@ -646,12 +636,6 @@ void CMakeTool::fetchFromCapabilities(bool ignoreCache) const qCCritical(cmakeToolLog) << "Fetching capabilities failed: " << cmake.allOutput() << cmake.error(); m_introspection->m_haveCapabilitites = false; } - - Store newData{{"CleanedStdOut", cmake.cleanedStdOut()}}; - const auto result - = PersistentCacheStore::write(keyFromString("CMake_" + cmakeExecutable().toUserOutput()), - newData); - QTC_ASSERT_EXPECTED(result, return); } static int getVersion(const QVariantMap &obj, const QString &value) diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 0fa06e5ca14..cf13ad49c5b 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -74,7 +74,7 @@ public: static Utils::Id createId(); - bool isValid(bool ignoreCache = false) const; + bool isValid() const; Utils::Id id() const { return m_id; } Utils::Store toMap () const; @@ -91,7 +91,7 @@ public: bool autoCreateBuildDirectory() const; QList supportedGenerators() const; CMakeKeywords keywords(); - bool hasFileApi(bool ignoreCache = false) const; + bool hasFileApi() const; Version version() const; QString versionDisplay() const; @@ -113,14 +113,14 @@ public: static void openCMakeHelpUrl(const CMakeTool *tool, const QString &linkUrl); private: - void readInformation(bool ignoreCache = false) const; + void readInformation() const; void runCMake(Utils::Process &proc, const QStringList &args, int timeoutS = 1) const; void parseFunctionDetailsOutput(const QString &output); QStringList parseVariableOutput(const QString &output); QStringList parseSyntaxHighlightingXml(); - void fetchFromCapabilities(bool ignoreCache = false) const; + void fetchFromCapabilities() const; void parseFromCapabilities(const QString &input) const; // Note: New items here need also be handled in CMakeToolItemModel::apply() diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 01c8b6cadb7..a0bd4d426e3 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -301,9 +301,14 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t, continue; const FilePath buildDir = relativeLibs ? buildDirectory : currentBuildDir; - std::optional dllName; + FilePath tmp = buildDir.resolvePath(part); + if (f.role == "libraries") + tmp = tmp.parentDir(); + std::optional dllName; if (buildDir.osType() == OsTypeWindows && (f.role == "libraries")) { + part = FilePath::fromUserInput(part).fileName(); + // Skip object libraries on Windows. This case can happen with static qml plugins if (part.endsWith(".obj") || part.endsWith(".o")) continue; @@ -312,15 +317,17 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t, for (const QString &suffix : {QString(".lib"), QString(".dll.a"), QString(".a")}) { if (part.endsWith(suffix) && !dllName) - dllName = FilePath::fromUserInput( - part.chopped(suffix.length()).append(".dll")) - .fileName(); + dllName = part.chopped(suffix.length()).append(".dll"); } - } - FilePath tmp = buildDir.resolvePath(part); - if (f.role == "libraries") - tmp = tmp.parentDir(); + // MinGW has libQt6Core.a -> Qt6Core.dll + const QString mingwPrefix("lib"); + const QString mingwSuffix(".a"); + if (part.startsWith(mingwPrefix) && part.endsWith(mingwSuffix)) + dllName = part.chopped(mingwSuffix.length()) + .sliced(mingwPrefix.length()) + .append(".dll"); + } if (!tmp.isEmpty() && tmp.isDir()) { // f.role is libraryPath or frameworkPath @@ -349,6 +356,7 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t, } } ct.libraryDirectories = filteredUnique(librarySeachPaths); + qCInfo(cmakeLogger) << "libraryDirectories for target" << ct.title << ":" << ct.libraryDirectories; } return ct; } diff --git a/src/plugins/coreplugin/welcomepagehelper.cpp b/src/plugins/coreplugin/welcomepagehelper.cpp index 9ae08c69384..9cad69cdf17 100644 --- a/src/plugins/coreplugin/welcomepagehelper.cpp +++ b/src/plugins/coreplugin/welcomepagehelper.cpp @@ -100,7 +100,7 @@ static const TextFormat &buttonTF(Button::Role role, WidgetState state) using namespace WelcomePageHelpers; static const TextFormat mediumPrimaryTF {Theme::Token_Basic_White, StyleHelper::UiElement::UiElementButtonMedium, - Qt::AlignCenter | Qt::TextDontClip}; + Qt::AlignCenter | Qt::TextDontClip | Qt::TextShowMnemonic}; static const TextFormat mediumSecondaryTF {Theme::Token_Text_Default, mediumPrimaryTF.uiElement, mediumPrimaryTF.drawTextFlags}; static const TextFormat smallPrimaryTF @@ -110,7 +110,7 @@ static const TextFormat &buttonTF(Button::Role role, WidgetState state) {mediumSecondaryTF.themeColor, smallPrimaryTF.uiElement, smallPrimaryTF.drawTextFlags}; static const TextFormat smallListDefaultTF {Theme::Token_Text_Default, StyleHelper::UiElement::UiElementIconStandard, - Qt::AlignLeft | Qt::AlignVCenter | Qt::TextDontClip}; + Qt::AlignLeft | Qt::AlignVCenter | Qt::TextDontClip | Qt::TextShowMnemonic}; static const TextFormat smallListCheckedTF = smallListDefaultTF; static const TextFormat smallLinkDefaultTF {Theme::Token_Text_Default, StyleHelper::UiElement::UiElementIconStandard, @@ -137,6 +137,8 @@ Button::Button(const QString &text, Role role, QWidget *parent) , m_role(role) { setText(text); + setAttribute(Qt::WA_Hover); + updateMargins(); if (m_role == SmallList) setCheckable(true); diff --git a/src/plugins/coreplugin/welcomepagehelper.h b/src/plugins/coreplugin/welcomepagehelper.h index e55a5663e9a..cce3b812527 100644 --- a/src/plugins/coreplugin/welcomepagehelper.h +++ b/src/plugins/coreplugin/welcomepagehelper.h @@ -54,7 +54,8 @@ public: const Utils::Theme::Color themeColor; const Utils::StyleHelper::UiElement uiElement; - const int drawTextFlags = Qt::AlignLeft | Qt::AlignBottom | Qt::TextDontClip; + const int drawTextFlags = Qt::AlignLeft | Qt::AlignBottom | Qt::TextDontClip + | Qt::TextShowMnemonic; }; CORE_EXPORT void setBackgroundColor(QWidget *widget, Utils::Theme::Color colorRole); @@ -62,7 +63,7 @@ constexpr qreal defaultCardBackgroundRounding = 3.75; constexpr Utils::Theme::Color cardDefaultBackground = Utils::Theme::Token_Background_Muted; constexpr Utils::Theme::Color cardDefaultStroke = Utils::Theme::Token_Stroke_Subtle; constexpr Utils::Theme::Color cardHoverBackground = Utils::Theme::Token_Background_Subtle; -constexpr Utils::Theme::Color cardHoverStroke = cardHoverBackground; +constexpr Utils::Theme::Color cardHoverStroke = cardDefaultStroke; CORE_EXPORT void drawCardBackground(QPainter *painter, const QRectF &rect, const QBrush &fill, const QPen &pen = QPen(Qt::NoPen), qreal rounding = defaultCardBackgroundRounding); diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.cpp b/src/plugins/cppeditor/cppcodestylesettingspage.cpp index 2ad6ba8baa9..ba0fc189417 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.cpp +++ b/src/plugins/cppeditor/cppcodestylesettingspage.cpp @@ -562,7 +562,7 @@ public: CppCodeStyleSettingsPageWidget() { CppCodeStylePreferences *originalCodeStylePreferences = CppToolsSettings::cppCodeStyle(); - m_pageCppCodeStylePreferences = new CppCodeStylePreferences(); + m_pageCppCodeStylePreferences.reset(new CppCodeStylePreferences); m_pageCppCodeStylePreferences->setDelegatingPool( originalCodeStylePreferences->delegatingPool()); m_pageCppCodeStylePreferences->setCodeStyleSettings( @@ -573,7 +573,7 @@ public: m_pageCppCodeStylePreferences->setId(originalCodeStylePreferences->id()); m_codeStyleEditor = TextEditorSettings::codeStyleFactory(CppEditor::Constants::CPP_SETTINGS_ID) - ->createCodeStyleEditor(m_pageCppCodeStylePreferences); + ->createCodeStyleEditor(m_pageCppCodeStylePreferences.get()); auto hbox = new QVBoxLayout(this); hbox->addWidget(m_codeStyleEditor); @@ -603,7 +603,7 @@ public: m_codeStyleEditor->finish(); } - CppCodeStylePreferences *m_pageCppCodeStylePreferences = nullptr; + std::unique_ptr m_pageCppCodeStylePreferences; CodeStyleEditorWidget *m_codeStyleEditor; }; diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 6f388d20dc1..44999e55618 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -237,15 +237,6 @@ void CdbEngine::adjustOperateByInstruction(bool operateByInstruction) runCommand({QLatin1String(m_lastOperateByInstruction ? "l-t" : "l+t"), NoFlags}); } -bool CdbEngine::canHandleToolTip(const DebuggerToolTipContext &context) const -{ - Q_UNUSED(context) - // Tooltips matching local variables are already handled in the - // base class. We don't handle anything else here in CDB - // as it can slow debugging down. - return false; -} - // Determine full path to the CDB extension library. QString CdbEngine::extensionLibraryName(bool is64Bit, bool isArm) { diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index e0909d5338d..e5c50b8e413 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -26,8 +26,6 @@ public: explicit CdbEngine(); ~CdbEngine() override; - bool canHandleToolTip(const DebuggerToolTipContext &context) const override; - void setupEngine() override; void runEngine(); void shutdownInferior() override; diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 3c290c76dd8..444d36777be 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1438,6 +1438,9 @@ void DebuggerEnginePrivate::updateState() return; QTC_ASSERT(m_threadLabel, return); + if (m_isDying) + return; + const DebuggerState state = m_state; const bool companionPreventsAction = m_engine->companionPreventsActions(); @@ -1794,6 +1797,9 @@ void DebuggerEngine::notifyDebuggerProcessFinished(const ProcessResultData &resu case DebuggerFinished: // Nothing to do. break; + case EngineSetupRequested: + notifyEngineSetupFailed(); + break; case EngineShutdownRequested: case InferiorShutdownRequested: notifyEngineShutdownFinished(); @@ -2011,11 +2017,16 @@ void DebuggerEngine::quitDebugger() case EngineShutdownRequested: case InferiorShutdownRequested: break; - case EngineRunFailed: - case DebuggerFinished: + case DebuggerNotReady: + case EngineSetupFailed: case InferiorShutdownFinished: + case EngineRunFailed: + case EngineShutdownFinished: + case DebuggerFinished: break; - default: + case InferiorRunRequested: + case InferiorRunFailed: + case InferiorStopRequested: // FIXME: We should disable the actions connected to that. notifyInferiorIll(); break; diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 171df7625f8..0e53afad359 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include @@ -198,6 +200,11 @@ void LldbEngine::setupEngine() environment.appendOrSet("PYTHONPATH", "/usr/lib/llvm-14/lib/python3.10/dist-packages"); } + if (runParameters().runAsRoot) { + ProjectExplorer::RunControl::provideAskPassEntry(environment); + m_lldbProc.setRunAsRoot(true); + } + m_lldbProc.setEnvironment(environment); if (runParameters().debugger.workingDirectory.isDir()) diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 27624f61dd3..dda927f0f17 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -478,12 +478,11 @@ void QmlEngine::gotoLocation(const Location &location) void QmlEngine::closeConnection() { - if (d->connectionTimer.isActive()) { - d->connectionTimer.stop(); - } else { - if (QmlDebugConnection *connection = d->connection()) - connection->close(); - } + d->automaticConnect = false; + d->retryOnConnectFail = false; + d->connectionTimer.stop(); + if (QmlDebugConnection *connection = d->connection()) + connection->close(); } void QmlEngine::startProcess() @@ -515,8 +514,8 @@ void QmlEngine::shutdownInferior() d->runCommand({DISCONNECT}); resetLocation(); - stopProcess(); closeConnection(); + stopProcess(); notifyInferiorShutdownFinished(); } @@ -574,6 +573,10 @@ void QmlEngine::continueInferior() void QmlEngine::interruptInferior() { + if (isDying()) { + notifyInferiorStopOk(); + return; + } showMessage(INTERRUPT, LogInput); d->runDirectCommand(INTERRUPT); showStatusMessage(Tr::tr("Waiting for JavaScript engine to interrupt on next statement.")); @@ -948,6 +951,8 @@ Context QmlEngine::languageContext() const void QmlEngine::disconnected() { + if (isDying()) + return; showMessage(Tr::tr("QML Debugger disconnected."), StatusBar); notifyInferiorExited(); } @@ -1122,6 +1127,8 @@ bool QmlEngine::isConnected() const void QmlEngine::showConnectionStateMessage(const QString &message) { + if (isDying()) + return; showMessage("QML Debugger: " + message, LogStatus); } diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 69098b732db..c54bd000ebe 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -937,11 +937,6 @@ expected_str DockerDevicePrivate::updateContainerAccess() return {}; } - if (QThread::currentThread() != thread()) { - expected_str result; - return make_unexpected(Tr::tr("Cannot start docker device from non-main thread")); - } - if (m_isShutdown) return make_unexpected(Tr::tr("Device is shut down")); @@ -949,14 +944,16 @@ expected_str DockerDevicePrivate::updateContainerAccess() return make_unexpected(Tr::tr("Docker system is not reachable")); expected_str result = startContainer(); - if (result) { - deviceSettings->containerStatus.setText(Tr::tr("Running")); - return result; - } + QString containerStatus = result ? Tr::tr("Running") : result.error().trimmed(); - const QString error = QString("Failed to start container: %1").arg(result.error()); - deviceSettings->containerStatus.setText(result.error().trimmed()); - return make_unexpected(error); + if (!result) + result = make_unexpected(QString("Failed to start container: %1").arg(result.error())); + + QTimer::singleShot(0, this, [this, containerStatus] { + deviceSettings->containerStatus.setText(containerStatus); + }); + + return result; } void DockerDevice::setMounts(const QStringList &mounts) const diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 0a4da9b874e..503e79e2b8b 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -181,7 +181,7 @@ LanguageClientSettingsPageWidget::LanguageClientSettingsPageWidget(LanguageClien this, &LanguageClientSettingsPageWidget::currentChanged); auto buttonLayout = new QVBoxLayout(); auto addButton = new QPushButton(Tr::tr("&Add")); - auto addMenu = new QMenu; + auto addMenu = new QMenu(this); addMenu->clear(); for (const ClientType &type : clientTypes()) { auto action = new QAction(type.name); diff --git a/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp b/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp index 4100052cbd5..66f059ec88a 100644 --- a/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp +++ b/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp @@ -81,7 +81,7 @@ McuKitCreationDialog::McuKitCreationDialog(const MessagesList &messages, if (messages.empty()) { fixButton->setVisible(false); m_informationLabel->setText( - QCoreApplication::translate("QtC::Autotest", "No errors detected")); + QCoreApplication::translate("QtC::Autotest", "No errors detected.")); } if (messages.size() < 2) { diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp index a7405ef46e2..dfcfc83a1be 100644 --- a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp @@ -77,7 +77,7 @@ private: DeviceManager * const m_deviceManager; DeviceManagerModel * const m_deviceManagerModel; QList m_additionalActionButtons; - IDeviceWidget *m_configWidget; + IDeviceWidget *m_configWidget = nullptr; QLabel *m_configurationLabel; QComboBox *m_configurationComboBox; @@ -97,7 +97,6 @@ private: DeviceSettingsWidget::DeviceSettingsWidget() : m_deviceManager(DeviceManager::cloneInstance()) , m_deviceManagerModel(new DeviceManagerModel(m_deviceManager, this)) - , m_configWidget(nullptr) { m_configurationLabel = new QLabel(Tr::tr("&Device:")); m_configurationComboBox = new QComboBox; @@ -116,7 +115,7 @@ DeviceSettingsWidget::DeviceSettingsWidget() connect(addButton, &OptionPushButton::clicked, this, &DeviceSettingsWidget::addDevice); QMenu *deviceTypeMenu = new QMenu(addButton); - QAction *defaultAction = new QAction(Tr::tr("&Start Wizard to Add Device...")); + QAction *defaultAction = new QAction(Tr::tr("&Start Wizard to Add Device..."), this); connect(defaultAction, &QAction::triggered, this, &DeviceSettingsWidget::addDevice); deviceTypeMenu->addAction(defaultAction); deviceTypeMenu->addSeparator(); @@ -128,7 +127,7 @@ DeviceSettingsWidget::DeviceSettingsWidget() continue; //: Add - QAction *action = new QAction(Tr::tr("Add %1").arg(factory->displayName())); + QAction *action = new QAction(Tr::tr("Add %1").arg(factory->displayName()), this); deviceTypeMenu->addAction(action); connect(action, &QAction::triggered, this, [factory, this] { diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 7f2eee43db7..1bb1629ef79 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -465,7 +465,6 @@ void Project::removeAllVanishedTargets() Target *Project::createKitAndTargetFromStore(const Utils::Store &store) { - const Id id = idFromMap(store); Id deviceTypeId = Id::fromSetting(store.value(Target::deviceTypeKey())); if (!deviceTypeId.isValid()) deviceTypeId = Constants::DESKTOP_DEVICE_TYPE; @@ -478,8 +477,7 @@ Target *Project::createKitAndTargetFromStore(const Utils::Store &store) kit->setUnexpandedDisplayName(kitName); DeviceTypeKitAspect::setDeviceTypeId(kit, deviceTypeId); kit->setup(); - }, - id); + }); QTC_ASSERT(k, return nullptr); auto t = std::make_unique(this, k, Target::_constructor_tag{}); if (!t->fromMap(store)) diff --git a/src/plugins/projectexplorer/projectexplorersettings.cpp b/src/plugins/projectexplorer/projectexplorersettings.cpp index 6cd79ce8f0b..b99a38d461d 100644 --- a/src/plugins/projectexplorer/projectexplorersettings.cpp +++ b/src/plugins/projectexplorer/projectexplorersettings.cpp @@ -196,7 +196,7 @@ ProjectExplorerSettingsWidget::ProjectExplorerSettingsWidget() m_jomCheckbox->setVisible(HostOsInfo::isWindowsHost()); jomLabel->setVisible(HostOsInfo::isWindowsHost()); - m_directoryButtonGroup = new QButtonGroup; + m_directoryButtonGroup = new QButtonGroup(this); m_directoryButtonGroup->setExclusive(true); m_directoryButtonGroup->addButton(m_currentDirectoryRadioButton, UseCurrentDirectory); m_directoryButtonGroup->addButton(m_directoryRadioButton, UseProjectDirectory); diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index 27b5b742c7b..470e64cf198 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -307,7 +307,7 @@ public: StaticTreeItem *parentForToolChain(Toolchain *tc); QAction *createAction(const QString &name, ToolchainFactory *factory, Utils::Id language) { - auto action = new QAction(name, nullptr); + auto action = new QAction(name, this); connect(action, &QAction::triggered, this, [this, factory, language] { createToolChain(factory, language); }); return action; diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index 2f2fcbaace1..8d30659f31b 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -419,6 +419,7 @@ public: , m_mainGroup(new QGroupBox(Tr::tr("Use Python Language Server"))) { + m_editor->setParent(this); m_mainGroup->setCheckable(true); auto mainGroupLayout = new QVBoxLayout; diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp index f012bdfd65d..bf97831cad9 100644 --- a/src/plugins/python/pythonutils.cpp +++ b/src/plugins/python/pythonutils.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -201,20 +200,10 @@ static bool isUsableHelper(QHash *cache, const QString &keyStrin auto it = cache->find(python); if (it == cache->end()) { const Key key = keyFromString(keyString); - const auto store = PersistentCacheStore::byKey(key); - if (store && store->value(keyFromString(python.toString())).toBool()) { - cache->insert(python, true); - return true; - } Process process; process.setCommand({python, QStringList{"-m", commandArg, "-h"}}); process.runBlocking(); const bool usable = process.result() == ProcessResult::FinishedWithSuccess; - if (usable) { - Store newStore = store.value_or(Store{}); - newStore.insert(keyFromString(python.toString()), true); - PersistentCacheStore::write(key, newStore); - } it = cache->insert(python, usable); } return *it; diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index be7d5fa042e..3f503c42311 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -478,6 +478,7 @@ add_qtc_plugin(QmlDesigner PLUGIN_DEPENDS Core ProjectExplorer QmlDesignerBase QmlJSEditor QmakeProjectManager QmlProjectManager QtSupport + PLUGIN_MANUAL_DEPENDS LicenseChecker ${IDE_VERSION} optional DEPENDS QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem Qt::QuickWidgets Qt::CorePrivate Qt::Xml Qt::Svg QmlDesignerCore Sqlite diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index 3002f4d8de8..85f904666c8 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -1724,7 +1724,7 @@ bool NodeMetaInfo::hasProperty(Utils::SmallStringView propertyName) const if constexpr (useProjectStorage()) return isValid() && bool(propertyId(*m_projectStorage, m_typeId, propertyName)); else - return isValid() && m_privateData->properties().contains(propertyName); + return isValid() && m_privateData->properties().contains(QByteArrayView(propertyName)); } PropertyMetaInfos NodeMetaInfo::properties() const diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index c871996a7bf..31638f76622 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -199,7 +199,7 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent) previewFileAction->setVisible(fileNode && fileNode->fileType() == FileType::QML); }); connect(Core::EditorManager::instance(), &Core::EditorManager::editorOpened, this, - [runPreviewAction] (Core::IEditor *editor) { + [] (Core::IEditor *editor) { if (!editor) return; if (!editor->document()) @@ -225,8 +225,8 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent) {":/utils/images/run_small.png", Utils::Theme::IconsRunToolBarColor}, {":/utils/images/eyeoverlay.png", Utils::Theme::IconsDebugColor} }).icon(); - Utils::ProxyAction *action = - Utils::ProxyAction::proxyActionWithIcon(runPreviewAction, icon); + Utils::ProxyAction *action = Utils::ProxyAction::proxyActionWithIcon( + Core::ActionManager::command("QmlPreview.RunPreview")->action(), icon); toolBar->insertAction(nullptr, action); }); diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp index 6a74d620dbc..31856271d15 100644 --- a/src/plugins/qnx/qnxqtversion.cpp +++ b/src/plugins/qnx/qnxqtversion.cpp @@ -116,9 +116,9 @@ Store QnxQtVersion::toMap() const return result; } -void QnxQtVersion::fromMap(const Store &map, const FilePath &, bool forceRefreshCache) +void QnxQtVersion::fromMap(const Store &map, const FilePath &) { - QtVersion::fromMap(map, {}, forceRefreshCache); + QtVersion::fromMap(map, {}); setSdpPath(FilePath::fromSettings(map.value(SDP_PATH_KEY))); } diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h index db6c47666d8..309e881f5a9 100644 --- a/src/plugins/qnx/qnxqtversion.h +++ b/src/plugins/qnx/qnxqtversion.h @@ -28,9 +28,7 @@ public: QString cpuDir() const; Utils::Store toMap() const override; - void fromMap(const Utils::Store &map, - const Utils::FilePath &filePath, - bool forceRefreshCache) override; + void fromMap(const Utils::Store &map, const Utils::FilePath &filePath) override; ProjectExplorer::Abis detectQtAbis() const override; diff --git a/src/plugins/qtapplicationmanager/appmanagerinstallpackagestep.cpp b/src/plugins/qtapplicationmanager/appmanagerinstallpackagestep.cpp index 67c9f6bec6f..49ba78f669f 100644 --- a/src/plugins/qtapplicationmanager/appmanagerinstallpackagestep.cpp +++ b/src/plugins/qtapplicationmanager/appmanagerinstallpackagestep.cpp @@ -74,7 +74,8 @@ AppManagerInstallPackageStep::AppManagerInstallPackageStep(BuildStepList *bsl, I const TargetInformation targetInformation(target()); - if (DeviceKitAspect::device(kit())->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { + IDeviceConstPtr device = DeviceKitAspect::device(kit()); + if (device && device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { packageFile.setDefaultPathValue(targetInformation.packageFilePath); } else { const Utils::FilePath packageFilePath = targetInformation.runDirectory.pathAppended( diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index ccc72baf6ec..f94ff8ccf2f 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -250,19 +249,6 @@ static QSet versionedIds(const QVersionNumber &version) version.majorVersion(), version.minorVersion()); } -// Wrapper to make the std::unique_ptr "copyable": -class MacroExpanderWrapper -{ -public: - MacroExpanderWrapper() = default; - MacroExpanderWrapper(const MacroExpanderWrapper &other) { Q_UNUSED(other) } - MacroExpanderWrapper(MacroExpanderWrapper &&other) = default; - - MacroExpander *macroExpander(const QtVersion *qtversion) const; -private: - mutable std::unique_ptr m_expander; -}; - enum HostBinaries { Designer, Linguist, Rcc, Uic, QScxmlc }; class QtVersionPrivate @@ -330,19 +316,9 @@ public: FilePath m_qmlRuntimePath; FilePath m_qmlplugindumpPath; - MacroExpanderWrapper m_expander; + std::unique_ptr m_expander; }; -/////////////// -// MacroExpanderWrapper -/////////////// -MacroExpander *MacroExpanderWrapper::macroExpander(const QtVersion *qtversion) const -{ - if (!m_expander) - m_expander = QtVersion::createMacroExpander([qtversion]() { return qtversion; }); - return m_expander.get(); -} - } // Internal /////////////// @@ -741,7 +717,7 @@ bool QtVersion::hasReleaseBuild() const return !d->m_defaultConfigIsDebug || d->m_defaultConfigIsDebugAndRelease; } -void QtVersion::fromMap(const Store &map, const FilePath &filePath, bool forceRefreshCache) +void QtVersion::fromMap(const Store &map, const FilePath &filePath) { d->m_id = map.value(Constants::QTVERSIONID).toInt(); if (d->m_id == -1) // this happens on adding from installer, see updateFromInstaller => get a new unique id @@ -768,12 +744,6 @@ void QtVersion::fromMap(const Store &map, const FilePath &filePath, bool forceRe } d->m_qmakeCommand = filePath.resolvePath(d->m_qmakeCommand); - const expected_str persistentStore = PersistentCacheStore::byKey( - Key("QtVersionData" + d->m_qmakeCommand.toString().toUtf8())); - - if (persistentStore && !forceRefreshCache) - d->m_data.fromMap(*persistentStore); - Store::const_iterator itQtAbis = map.find(QTVERSION_ABIS); if (itQtAbis != map.end()) { // Only the SDK Tool writes abis to the settings. If we find abis in the settings, we want @@ -804,11 +774,6 @@ Store QtVersion::toMap() const result.insert(QTVERSIONQMAKEPATH, qmakeFilePath().toSettings()); - if (d->m_data.versionInfoUpToDate) { - PersistentCacheStore::write(Key("QtVersionData" + d->m_qmakeCommand.toString().toUtf8()), - d->m_data.toMap()); - } - return result; } @@ -1419,9 +1384,6 @@ void QtVersionPrivate::updateVersionInfo() m_isUpdating = false; m_data.versionInfoUpToDate = true; - - PersistentCacheStore::write(Key("QtVersionData" + m_qmakeCommand.toString().toUtf8()), - m_data.toMap()); } QHash QtVersionPrivate::versionInfo() @@ -1504,7 +1466,9 @@ FilePaths QtVersion::qtSoPaths() const MacroExpander *QtVersion::macroExpander() const { - return d->m_expander.macroExpander(this); + if (!d->m_expander) + d->m_expander = QtVersion::createMacroExpander([this] { return this; }); + return d->m_expander.get(); } std::unique_ptr @@ -2463,13 +2427,13 @@ QtVersion *QtVersionFactory::create() const return version; } -QtVersion *QtVersion::clone(bool forceRefreshCache) const +QtVersion *QtVersion::clone() const { for (QtVersionFactory *factory : std::as_const(g_qtVersionFactories)) { if (factory->m_supportedType == d->m_type) { QtVersion *version = factory->create(); QTC_ASSERT(version, return nullptr); - version->fromMap(toMap(), {}, forceRefreshCache); + version->fromMap(toMap(), {}); // Qt Abis are either provided by SDK Tool, or detected from the binaries. // The auto detection is not perfect, and we always want to use the data provided by diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index 4220900fd34..5357a521cdb 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -49,9 +49,7 @@ public: virtual ~QtVersion(); - virtual void fromMap(const Utils::Store &map, - const Utils::FilePath &filePath = {}, - bool forceRefreshCache = false); + virtual void fromMap(const Utils::Store &map, const Utils::FilePath &filePath = {}); virtual bool equals(QtVersion *other); bool isAutodetected() const; @@ -223,7 +221,7 @@ private: friend class Internal::QtSettingsPageWidget; void setId(int id); - QtVersion *clone(bool forceRefreshCache = false) const; + QtVersion *clone() const; Internal::QtVersionPrivate *d = nullptr; }; diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index e81535acb42..bb424077855 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -454,8 +454,10 @@ bool ExamplesViewController::isVisible() const void ExampleSetModel::updateQtVersionList() { - QtVersions versions = QtVersionManager::sortVersions(QtVersionManager::versions( - [](const QtVersion *v) { return v->hasExamples() || v->hasDemos(); })); + QtVersions versions = QtVersionManager::sortVersions( + QtVersionManager::versions([](const QtVersion *v) { + return !v->qmakeFilePath().needsDevice() && (v->hasExamples() || v->hasDemos()); + })); // prioritize default qt version ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit(); diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index a33514b836f..7eb349d1da9 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -602,7 +602,7 @@ void QtSettingsPageWidget::updateQtVersions(const QList &additions, const Q // Add changed/added items: for (int a : std::as_const(toAdd)) { - QtVersion *version = QtVersionManager::version(a)->clone(true); + QtVersion *version = QtVersionManager::version(a)->clone(); auto *item = new QtVersionItem(version); // Insert in the right place: diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index e29533a41b5..e327a4c9148 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -865,7 +866,10 @@ public: void closeShell() { - m_shell.reset(); + if (QObject *shell = m_shell.get()) { + m_shell = nullptr; + shell->deleteLater(); + } } // Call me with shell mutex locked @@ -881,10 +885,10 @@ public: << m_displaylessSshParameters.host()); cmd.addArg("/bin/sh"); - m_shell.reset(new LinuxDeviceShell(cmd, - FilePath::fromString(QString("ssh://%1/").arg(parameters.userAtHostAndPort())))); + m_shell = new LinuxDeviceShell(cmd, + FilePath::fromString(QString("ssh://%1/").arg(parameters.userAtHostAndPort()))); connect(m_shell.get(), &DeviceShell::done, this, [this] { - m_shell.release()->deleteLater(); + closeShell(); }); auto result = m_shell->start(); if (!result) { @@ -981,7 +985,7 @@ private: mutable QMutex m_mutex; SshParameters m_displaylessSshParameters; QList m_connections; - std::unique_ptr m_shell; + QPointer m_shell; }; // LinuxDevice diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index aad08703064..7380f01868b 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -330,8 +330,6 @@ void GenericLinuxDeviceTester::testDevice(const IDevice::Ptr &deviceConfiguratio d->m_device = std::static_pointer_cast(deviceConfiguration); d->m_connectionTest = new QFutureWatcher(this); - d->m_connectionTest->setFuture(d->m_device->tryToConnect()); - connect(d->m_connectionTest, &QFutureWatcher::finished, this, [this] { const bool success = d->m_connectionTest->result(); d->m_connectionTest->deleteLater(); @@ -345,6 +343,7 @@ void GenericLinuxDeviceTester::testDevice(const IDevice::Ptr &deviceConfiguratio emit finished(TestFailure); } }); + d->m_connectionTest->setFuture(d->m_device->tryToConnect()); } void GenericLinuxDeviceTester::stopTest() diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 1e9b24ff014..2bd0fa403dd 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -280,9 +280,10 @@ void TerminalWidget::setupActions() pasteAction.addOnTriggered(this, &TerminalWidget::pasteFromClipboard); m_paste = make_registered(pasteAction); - ActionBuilder closeAction(this, Core::Constants::CLOSE); - closeAction.setContext(m_context); - closeAction.addOnTriggered(this, &TerminalWidget::closeTerminal); + ActionBuilder(this, Core::Constants::CLOSE) + .setContext(m_context) + .addOnTriggered(this, &TerminalWidget::closeTerminal) + .setText(Tr::tr("Close Terminal")); // We do not register the close action, as we want it to be blocked if the keyboard is locked. ActionBuilder clearTerminalAction(this, Constants::CLEAR_TERMINAL); @@ -689,9 +690,6 @@ void TerminalWidget::initActions(QObject *parent) moveCursorWordRightAction.setText(Tr::tr("Move Cursor Word Right")); moveCursorWordRightAction.setContext(context); moveCursorWordRightAction.setDefaultKeySequence({QKeySequence("Alt+Right")}); - - ActionBuilder closeAction(parent, Core::Constants::CLOSE); - closeAction.setText(Tr::tr("Close Terminal")); } void TerminalWidget::unlockGlobalAction(const Utils::Id &commandId) diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 994d097024c..069fe1e2630 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -139,7 +139,7 @@ public: const QPixmap croppedLogo = logo.copy(cropR); const int lineHeight = welcomeTF.lineHeight(); const QPixmap scaledCroppedLogo = - croppedLogo.scaledToHeight((lineHeight - 12) * devicePixelRatioF(), + croppedLogo.scaledToHeight((lineHeight - 12) * croppedLogo.devicePixelRatioF(), Qt::SmoothTransformation); ideIconLabel->setPixmap(scaledCroppedLogo); ideIconLabel->setFixedHeight(lineHeight);