diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 116f84c85ea..c53b479982d 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/android/androiddev.qdoc b/doc/qtcreator/src/android/androiddev.qdoc index 7e172f0650a..c0fe2cedea0 100644 --- a/doc/qtcreator/src/android/androiddev.qdoc +++ b/doc/qtcreator/src/android/androiddev.qdoc @@ -202,7 +202,7 @@ To start an AVD, select \uicontrol {Start AVD}. Usually, you don't need to start AVDs separately because \QC starts them when you - select them in the \l{Building for Multiple Platforms}{kit selector} to + select them in the \l{Build for many platforms}{kit selector} to \l{Deploying to Android}{deploy applications} to them. To remove an AVD from the list and the kit selector, select diff --git a/doc/qtcreator/src/android/deploying-android.qdoc b/doc/qtcreator/src/android/deploying-android.qdoc index 2926d7739bd..2b3441290f3 100644 --- a/doc/qtcreator/src/android/deploying-android.qdoc +++ b/doc/qtcreator/src/android/deploying-android.qdoc @@ -61,7 +61,7 @@ To remove the current deployment method, select \uicontrol Remove. \QC deploys the packages on the Android device that you select in the - \l{Building for Multiple Platforms}{kit selector}. To add devices, select + \l{Build for many platforms}{kit selector}. To add devices, select \uicontrol Manage. For more information about specifying additional start options for 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/baremetal/creator-baremetal-dev.qdoc b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc index dfde42b473e..96fabb36244 100644 --- a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc +++ b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc @@ -262,7 +262,7 @@ You can build applications for and run them on bare metal devices in the same way as for and on the desktop. For more information, see - \l{Building for Multiple Platforms} and \l{Run on many platforms}. + \l{Build for many platforms} and \l{Run on many platforms}. \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc index 0bf54dde2fb..aac591854cd 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 @@ -297,5 +301,5 @@ \sa {Activate kits for a project}, {Add custom output parsers}, {Configure projects for building}, {Configure projects for running}, - {Open projects}, {CMake} + {Build with CMake}{How To: Build with CMake}, {Open projects}, {CMake} */ diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc index a1130b7a89e..3fe99abfdf6 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc @@ -47,8 +47,8 @@ Typically, you cannot compile such projects without manual changes. \endlist - \sa {Build with CMake}{How To: Build with CMake}, {CMake Build Configuration}, - {Configure projects for building}, {Configure projects for running}, + \sa {Configure projects for building}, {Configure projects for running}, + {Build with CMake}{How To: Build with CMake}, {CMake Build Configuration}, {Debug CMake project files}, {Deploying to Remote Linux}, {Open projects}, {Use compilation databases} */ @@ -70,9 +70,8 @@ \image qtcreator-projects-view-edit.png {CMake project in Projects view} - To disable this - behavior, select \preferences > \uicontrol CMake > \uicontrol General, and - then deselect the \uicontrol {Autorun CMake} check box. + To disable this behavior, go to \preferences > \uicontrol CMake > + \uicontrol General and clear \uicontrol {Autorun CMake}. \image qtcreator-preferences-cmake-general.webp {General tab in CMake Preferences} @@ -100,7 +99,7 @@ box. The change takes effect after you select \uicontrol Build > \uicontrol {Run CMake}. - \sa {CMake}, {Manage files in CMake projects}, {Open projects}, + \sa {Build with CMake}{How To: Build with CMake}, {CMake}, {Open projects}, {File System}, {Projects} */ @@ -125,7 +124,8 @@ \li Switching to the Help mode \endlist - \sa {CMake}, {Read Documentation}{How To: Read Documentation} + \sa {Build with CMake}{How To: Build with CMake}, {CMake}, + {Read Documentation}{How To: Read Documentation} */ /*! @@ -183,7 +183,8 @@ \image qtcreator-kits-cmake.png {Kits preferences} - \sa {CMake}, {Add kits}, {kits-tab}{Kits} + \sa {Build with CMake}{How To: Build with CMake}, {CMake}, {Add kits}, + {kits-tab}{Kits} */ /*! @@ -234,8 +235,8 @@ Warnings and errors are displayed in \l {Issues}. - \sa {CMake}, {Add libraries to CMake projects}, {Complete CMake code}, - {Format CMake files}, {Completion}, {Snippets} + \sa {Build with CMake}{How To: Build with CMake}, {CMake}, {Completion}, + {Snippets} */ /*! @@ -263,7 +264,8 @@ Press \key Tab or \key Enter to accept the selected suggestion and complete the code. - \sa {CMake}, {Edit CMake configuration files}, {Completion}, {Snippets} + \sa {Build with CMake}{How To: Build with CMake}, {CMake}, {Completion}, + {Snippets} */ /*! @@ -297,8 +299,7 @@ current project. \endlist - \sa {CMake},{Complete CMake code}, {Edit CMake configuration files}, - {Edit MIME types} + \sa {Build with CMake}{How To: Build with CMake}, {Edit MIME types}, {CMake} */ /*! @@ -324,8 +325,7 @@ When you rename or remove files in the \l {Projects} or \l {File System} view, \QC renames them in the CMakeLists.txt file or removes them from it. - \sa {CMake}, {Add libraries to CMake projects}, {Create files}, - {Edit CMake configuration files}, {View CMake project contents}, + \sa {Create files}, {Build with CMake}{How To: Build with CMake}, {CMake}, {File System}, {Projects} */ @@ -377,6 +377,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") \endcode - \sa {CMake}, {Edit CMake configuration files}, {Complete CMake code}, - {Completion}, {Snippets} + \sa {Build with CMake}{How To: Build with CMake}, {CMake}, {Completion}, + {Snippets} */ 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/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 34ea75fc528..35bd896dff2 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -154,7 +154,7 @@ For \l {Creating a Qt for Python Application with Qt Widgets}{Python} projects, start debugging the \c main.py file. If you encounter problems, check the - active build target in the \l{Building for Multiple Platforms}{kit selector}. + active build target in the \l{Build for many platforms}{kit selector}. \section1 Debugger Operating Modes @@ -1992,7 +1992,7 @@ the right hand side to find out what went wrong. Always attach the contents of the pane to debugger-related questions to the \QC mailing list (qt-creator@qt-project.org) or paste them to a - \l{Pasting and Fetching Code Snippets}{code pasting service} before + \l{Paste and fetch code snippets}{code pasting service} before asking questions in the IRC (on the #qt-creator channel at Libera.Chat). \note Error 135 usually means that a dependent DLL cannot be found. diff --git a/doc/qtcreator/src/editors/creator-coding.qdoc b/doc/qtcreator/src/editors/creator-coding.qdoc index 5df03c90ccd..781fbef65bf 100644 --- a/doc/qtcreator/src/editors/creator-coding.qdoc +++ b/doc/qtcreator/src/editors/creator-coding.qdoc @@ -56,9 +56,5 @@ \endlist - \if defined(qtcreator) - \sa {Using GitHub Copilot} - \else \sa {Apply quick fixes} - \endif */ 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..a720f795346 100644 --- a/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc @@ -57,24 +57,9 @@ few people can visualize the color \c {#18793f}. To easily edit these properties, you can use the Qt Quick Toolbars. - \if defined(qtcreator) - \li \l{Pasting and Fetching Code Snippets} - - You can cooperate with others by pasting and fetching - snippets of code from a server. For example, you might ask - 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..735ca3066c9 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc @@ -1,16 +1,16 @@ -// Copyright (C) 2019 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 qt-quick-toolbars.html \page creator-editor-codepasting.html - \nextpage creator-macros.html + \previouspage creator-how-tos.html - \title Pasting and Fetching Code Snippets + \ingroup creator-how-to-edit - In \QC, you can paste snippets of code to a server or fetch snippets of - code from the server. To paste and fetch snippets of code, \QC uses the - following: + \title Paste and fetch code snippets + + To paste snippets of code to a server or fetch snippets of code from the + server, use one of the following code pasting services: \list \li \uicontrol {Pastebin.Com} @@ -18,59 +18,72 @@ \li \uicontrol {Shared network drives} \endlist - \section1 Specifying Settings for Code Pasting + For example, you might ask colleagues to review a change that you plan to + submit to a version control system. If you use the Git version control + system, create a \e{diff} view by going to \uicontrol Tools > + \uicontrol Git > \uicontrol {Local Repository} > \uicontrol Diff. + Then, upload its contents to the server by going to \uicontrol Tools > + \uicontrol {Code Pasting} > \uicontrol {Paste Snippet}. - To specify settings for the code pasting service: + The reviewers can retrieve the code snippet by selecting \uicontrol Tools > + \uicontrol {Code Pasting} > \uicontrol {Fetch Snippet}. If they have the + project currently opened in \QC, they can apply and test the change by + going to \uicontrol Tools > \uicontrol Git > \uicontrol {Local Repository} + > \uicontrol Patch > \uicontrol {Apply from Editor}. - \list 1 - \li Select \preferences > \uicontrol {Code Pasting}. - \image qtcreator-code-pasting-options.png "Code Pasting preferences" - \li In the \uicontrol {Default protocol} field, select a code pasting - service to use by default. - \li In the \uicontrol Username field, enter your username. - \li In the \uicontrol {Expires after} field, specify the time to keep - the pasted snippet on the server. - \li Select the \uicontrol {Copy-paste URL to clipboard} check box to - copy the URL of the post on the code pasting service to the - clipboard when you paste a post. - \li Select the \uicontrol {Display General Messages after sending a post} - check box to display the URL in \l{View output}{General Messages} - when you paste a post. - \endlist + \section1 Paste snippets - Select \uicontrol Fileshare to specify the path to a shared network drive. - The code snippets are copied to the drive as simple files. You have to - delete obsolete files from the drive manually. - - \section1 Using Code Pasting Services - - To paste a snippet of code onto the server, select \uicontrol Tools > + To paste a snippet of code onto the server, go to \uicontrol Tools > \uicontrol {Code Pasting} > \uicontrol {Paste Snippet} or press \key {Alt+C,Alt+P}. By default, \QC copies the URL of the snippet to the clipboard and displays the URL in \uicontrol {General Messages}. - To paste any content that you copied to the clipboard, select + To paste any content that you copied to the clipboard, go to \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 > - \uicontrol {Code Pasting} > \uicontrol {Fetch Snippet} or press - \key {Alt+C,Alt+F}. Select the snippet to fetch from the list. + \section1 Fetch snippets - To fetch the content stored at an URL, select \uicontrol Tools > + To fetch a snippet of code from the server: + + \list 1 + \li Go to \uicontrol Tools > \uicontrol {Code Pasting} > + \uicontrol {Fetch Snippet} or press \key {Alt+C,Alt+F}. + \li Select the snippet to fetch from the list. + \endlist + + To fetch the content stored at a URL, select \uicontrol Tools > \uicontrol {Code Pasting} > \uicontrol {Fetch from URL}. - For example, you might ask colleagues to review a change that you plan to - submit to a version control system. If you use the Git version control - system, you can create a \e{diff} view by selecting \uicontrol Tools > - \uicontrol Git > \uicontrol {Local Repository} > \uicontrol Diff. You can - then upload its contents to the server by selecting \uicontrol Tools > - \uicontrol {Code Pasting} > \uicontrol {Paste Snippet}. The reviewers can - retrieve the code snippet by selecting \uicontrol Tools > - \uicontrol {Code Pasting} > \uicontrol {Fetch Snippet}. If they have the - project currently opened in \QC, they can apply and test the change by - choosing \uicontrol Tools > \uicontrol Git > \uicontrol {Local Repository} - > \uicontrol Patch > \uicontrol {Apply from Editor}. + \section1 Set code pasting preferences + + To set preferences for a code pasting service: + + \list 1 + \li Go to \preferences > \uicontrol {Code Pasting} > \uicontrol General. + \image qtcreator-code-pasting-options.png {Code Pasting preferences} + \li In \uicontrol {Default protocol}, select a code pasting service to + use by default. + \li In \uicontrol Username, enter your username. + \li In \uicontrol {Expires after}, specify the time to keep + the pasted snippet on the server. + \li Select \uicontrol {Copy-paste URL to clipboard} to copy the URL of + the post on the code pasting service to the clipboard when you paste + a post. + \li Select \uicontrol {Display General Messages after sending a post} + to display the URL in \l{View output}{General Messages} + when you paste a post. + \endlist + + \section2 Set a shared network drive for code pasting + + Go to \preferences > \uicontrol {Code Pasting} > \uicontrol Fileshare to + specify the path to a shared network drive. + + The code snippets are copied to the drive as simple files. You have to + delete obsolete files from the drive manually. + + \sa {Git} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc index d2ca2681303..b3ded10f5d9 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc @@ -2,11 +2,12 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-language-servers.html \page creator-copilot.html - \nextpage creator-mime-types.html + \previouspage creator-how-tos.html - \title Using GitHub Copilot + \ingroup creator-how-to-edit + + \title Use GitHub Copilot The Copilot plugin (disabled by default) integrates \l{https://github.com/features/copilot}{GitHub Copilot} into \QC. @@ -31,44 +32,43 @@ {Copilot.vim/Readme.md}. \endlist - \section1 Setting Copilot Preferences + \section1 Set Copilot preferences To set preferences for using Copilot: \list 1 - \li Select \preferences > \uicontrol Copilot. + \li Go to \preferences > \uicontrol Copilot. \image qtcreator-preferences-copilot.webp {Copilot tab in Preferences} - \li Select the \uicontrol {Enable Copilot} check box to use Copilot. + \li Select \uicontrol {Enable Copilot} to use Copilot. \li Select \uicontrol {Sign In} to sign into your subscription, activate your device, and authorize the GitHub Copilot plugin. The button turns into a \uicontrol {Sign Out} button. - \li In the \uicontrol {Node.js path} field, enter the full path to the + \li In \uicontrol {Node.js path}, enter the full path to the Node.js executable. - \li In the \uicontrol {Path to agent.js} field, enter the path to + \li In \uicontrol {Path to agent.js}, enter the path to agent.js in the Copilot Neovim plugin installation folder. - \li Select the \uicontrol {Auto request} check box to receive suggestions + \li Select \uicontrol {Auto request} to receive suggestions for the current text cursor position when you make changes. - \li Select the \uicontrol {Use proxy} check box to use a proxy server to + \li Select \uicontrol {Use proxy} to use a proxy server to connect to Copilot servers. - \li In the \uicontrol {Proxy host} field, enter the host name of the + \li In \uicontrol {Proxy host}, enter the host name of the proxy server. + \li In \uicontrol {Proxy port}, enter the port number of the proxy server. - \li In the \uicontrol {Proxy port} field, enter the port number of the - proxy server. - \li Select the \uicontrol {Reject unauthorized} check box to prevent the + \li Select \uicontrol {Reject unauthorized} to prevent the security risk presented by accepting unauthorized certificates from the proxy server. - \li In the \uicontrol {Proxy user} field, enter the user name to + \li In \uicontrol {Proxy user}, enter the user name to authenticate to the proxy server. - \li Select the \uicontrol {Save proxy password} check box to save the + \li Select \uicontrol {Save proxy password} to save the password to authenticate to the proxy server. \note The password is saved insecurely. - \li In the \uicontrol {Proxy password} field, enter the password to save. - To see the password as you type, select the \inlineimage icons/original-size.png - button. + \li In \uicontrol {Proxy password}, enter the password to save. + To see the password as you type, select + \inlineimage icons/original-size.png. \endlist - \section1 Receiving Suggestions + \section1 Receive suggestions When you write code in the \l {Edit Mode}{Edit} mode and \uicontrol {Auto request} is enabled, Copilot automatically makes @@ -93,20 +93,19 @@ To reject a suggestion, press \key Esc or the arrow keys. - \section1 Enabling and Disabling Suggestions + \section1 Turn suggestions on and off - You can enable and disable the Copilot suggestions either globally for all + You can turn the Copilot suggestions on and off either globally for all projects or at project level for a particular project. - To enable or disable Copilot suggestions globally, select the - \inlineimage icons/copilot.png - (\uicontrol {Toggle Copilot}) button. This also sets the value of the - \uicontrol {Enable Copilot} check box in \preferences accordingly. + To turn Copilot suggestions on or off globally, select + \inlineimage icons/copilot.png (\uicontrol {Toggle Copilot}). This also + sets the value of \uicontrol {Enable Copilot} in \preferences > + \uicontrol Copilot accordingly. - To enable or disable Copilot suggestions for a particular project, - select \uicontrol Projects > \uicontrol {Project Settings} > - \uicontrol Copilot, and then select or deselect the - \uicontrol {Enable Copilot} check box. + To turn Copilot suggestions on or off for a particular project, + go to \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol Copilot and then select or clear \uicontrol {Enable Copilot}. - \sa {Enable and disable plugins} + \sa {Enable and disable plugins}, {Edit Mode} */ diff --git a/doc/qtcreator/src/editors/creator-diff-editor.qdoc b/doc/qtcreator/src/editors/creator-only/creator-diff-editor.qdoc similarity index 70% rename from doc/qtcreator/src/editors/creator-diff-editor.qdoc rename to doc/qtcreator/src/editors/creator-only/creator-diff-editor.qdoc index 8557cd8bffb..330af8d335e 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) - To send a chunk of changes to a \l{Pasting and Fetching Code Snippets} + \section1 Paste changes for review + + To send a chunk of changes to a \l{Paste and fetch 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-language-server.qdoc b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc index 897facbe4ac..b9b09a17e85 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc @@ -238,12 +238,13 @@ \image qtcreator-qml-js-editing.webp {QML/JS Editing preferences} - When using \c qmlls from Qt 6.7 or later, it is recommended - to set \l{QT_QML_GENERATE_QMLLS_INI} to \c{ON} in - \uicontrol {Initial Configuration}. + When using \c qmlls from Qt 6.7 or later, set \l{QT_QML_GENERATE_QMLLS_INI} + to \c{ON} in \uicontrol Projects > \uicontrol {Build Settings} + > \uicontrol {Initial Configuration}. \sa {Manage Language Servers}{How To: Manage Language Servers}, - {Enabling and Disabling Messages}, {Language Servers} + {Enabling and Disabling Messages}, {CMake Build Configuration}, + {Language Servers} */ /*! 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/howto/creator-only/creator-how-to-contact-qt.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-contact-qt.qdoc index 93b8844f240..2ca57713777 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-to-contact-qt.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-contact-qt.qdoc @@ -45,5 +45,5 @@ {#qt-creator} channel on Libera.Chat IRC, go to \uicontrol Help > \uicontrol Contact. - \sa {Pasting and Fetching Code Snippets}, {Technical Support} + \sa {Paste and fetch code snippets}, {Technical Support} */ 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/projects/creator-only/creator-build-settings-qmake.qdoc b/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc index 18906bee8d5..3f24273f09c 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc @@ -39,7 +39,7 @@ In the \uicontrol {Tooltip in target selector} field, you can enter text that is displayed as a tooltip when you hover the mouse over the build - configuration in the \l{Building for Multiple Platforms}{kit selector}. + configuration in the \l{Build for many platforms}{kit selector}. You can create separate versions of project files to keep platform-dependent code separate. You can use qmake \l{Adding Platform Specific Source Files} diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-building-running.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-building-running.qdoc index 3f54c09e1a3..bd4743a437b 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-building-running.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-building-running.qdoc @@ -12,9 +12,7 @@ \page creator-building-running.html \nextpage creator-live-preview.html - \title Building and Running - - \image front-preview.png + \title Running on Devices \QC supports running and deploying Qt applications that you build for different target platforms or with different compilers, debuggers, or @@ -31,12 +29,6 @@ Android and embedded Linux devices. The changes you make to the UI are instantly visible to you in the preview. - \li \l{Building for Multiple Platforms} - - \e {Build configurations} have everything you need to compile - the sources into binaries. Build configurations use the tools and settings - defined in their corresponding kit. - \li \l{Deploying to Devices} \e {Deploy configurations} handle the packaging and copying of diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc index 512a3886ab4..d42df965a7e 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc @@ -8,23 +8,26 @@ // ********************************************************************** /*! - \previouspage qt-design-viewer.html \page creator-building-targets.html - \nextpage creator-running-targets.html + \previouspage creator-how-tos.html - \title Building for Multiple Platforms + \ingroup creator-how-to-build - You can build applications for multiple target platforms, or using different + \title Build for many platforms + + You can build applications for many target platforms, or using different compilers, debuggers or Qt versions. \l{glossary-buildandrun-kit}{Kits} - define the tools, \l{glossary-device}{device} type and other settings to use. + define the tools, \l{glossary-device}{device} type, and other settings to use. By default, when you run the application, you automatically build and deploy it first. However, you can also perform each operation separately. To check that the application code can be compiled and linked for a device, - you can build the project. The build errors and warnings are displayed in - the \l Issues. More detailed information is displayed in \l {Compile Output}. + build the project. You can see build errors and warnings in \l Issues and + more details in \l {Compile Output}. + + \section1 Build an application To build an application: @@ -37,7 +40,7 @@ \image qtcreator-kit-selector.webp {Kit selector} - \li Choose \uicontrol Build > \uicontrol {Build Project} or press + \li Select \uicontrol Build > \uicontrol {Build Project} or press \key {Ctrl+B}. Or, select \inlineimage icons/run_small.png (\uicontrol Run) to @@ -45,23 +48,25 @@ \endlist + \section1 Cancel builds + While the application is being built, the \inlineimage icons/build.png (\uicontrol Build) button changes to a \inlineimage icons/cancel-build.png - (\uicontrol {Cancel Build}) button. To cancel the build, select - the button, press \key {Alt+Backspace}, or select \uicontrol Build > - \uicontrol {Cancel Build}. + (\uicontrol {Cancel Build}) button. To cancel the build: - If you selected a build command and - decide you would also like to run the application, you can select the - \uicontrol Run button to schedule running the project after building is done. + \list + \li Select \inlineimage icons/cancel-build.png. + \li Press \key {Alt+Backspace}. + \li Go to \uicontrol Build > \uicontrol {Cancel Build}. + \endlist - For more information on the options you have, see - \l{Specifying Build Settings}. + If you selected a build command and now would also like to run the + application, select the \uicontrol Run button to schedule running + the project after building is done. - \section1 Additional Build Commands + \section1 Build projects in several configurations - The \uicontrol Build menu has additional commands for building, - rebuilding, and cleaning projects. + Go to \uicontrol Build to build, rebuild, and clean projects. To build the current project in all its configurations, that is, for all build configurations in all enabled kits, select @@ -74,20 +79,24 @@ To build all open projects in all their configurations, select \uicontrol {Build All Projects for All Configurations}. + \section1 Build files or subprojects + To quickly check the compile output for changes that you made in one file or - subproject, you can use the \uicontrol Build menu commands to build a file or - subproject. The available build menu commands depend on the build system - you selected for the project: CMake, qmake, or Qbs. + subproject, use the \uicontrol Build menu commands to build it. The available + build menu commands depend on the build system you selected for the project: + CMake, qmake, or Qbs. Select \uicontrol {Build for Run Configuration} to build the executable that corresponds to the selected run configuration. You can also use the \c cm filter in the \l {Navigate with locator} {locator}. - To remove all build artifacts, select one of \uicontrol {Clean} menu commands. + \section1 Remove build artifacts + + To remove all build artifacts, go to \uicontrol Build > \uicontrol {Clean}. To clean the build directory and then build the project, select - one of \uicontrol {Rebuild} menu commands. + \uicontrol {Rebuild}. To build and clean projects without dependencies, select the \uicontrol {Build Without Dependencies}, @@ -95,30 +104,23 @@ \uicontrol {Clean Without Dependencies} options in the context menu in the \uicontrol Projects view. - To run qmake or CMake to regenerate build system files, select - \uicontrol Build > \uicontrol {Run qmake} or \uicontrol {Run CMake}. - - \section1 Building with CMake - - \QC automatically runs CMake when you make changes to \c {CMakeLists.txt} - files. To disable this feature, select \preferences > \uicontrol CMake > - \uicontrol General. Select the CMake executable to edit, and then deselect - the \uicontrol {Autorun CMake} check box. - - \image qtcreator-preferences-cmake-tools.webp "Tools tab in CMake Preferences" - - For more information, see \l {CMake}. - - \section1 Building with qmake - - To prevent failures on incremental builds, it might make sense - to always run qmake before building, even though it means that - building will take more time. To enable this option, select \preferences > - \uicontrol {Build & Run} > \uicontrol Qmake > - \uicontrol {Run qmake on every build}. - - \image qtcreator-preferences-build-run-qmake.png "qmake tab in Build & Run Preferences" - - \sa {Configure projects for building}, {Configure projects for running}, - {qmake Build Configuration} + \sa {Configure projects for building}, {Build and Run}{How To: Build and Run}, + {Adding Docker Devices}, {Specifying Build Settings} +*/ + +/*! + \page creator-how-to-run-qmake-before-building.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build-with-qmake + + \title Run qmake before building + + To prevent failures on incremental builds, always run qmake before building, + even though it takes more time. Go to \preferences > \uicontrol {Build & Run} + > \uicontrol Qmake, and select \uicontrol {Run qmake on every build}. + + \image qtcreator-preferences-build-run-qmake.png {Build & Run Qmake Preferences} + + \sa {Build and Run}{How To: Build and Run}, {qmake Build Configuration} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build-qbs.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build-qbs.qdoc index f6594671bcf..f1b08ac048a 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build-qbs.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build-qbs.qdoc @@ -22,7 +22,7 @@ In the \uicontrol {Tooltip in target selector} field, you can enter text that is displayed as a tooltip when you hover the mouse over the build - configuration in the \l{Building for Multiple Platforms}{kit selector}. + configuration in the \l{Build for many platforms}{kit selector}. You can enter a name for the build configuration in the \uicontrol {Configuration name} field. diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index c38beb825d3..14fe5e27cdb 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -32,14 +32,10 @@ \li \l{Semantic Highlighting} \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} \endlist - \li \l{Building and Running} + \li \l{Running on Devices} \list \li \l{Validating with Target Hardware} \list @@ -47,7 +43,6 @@ \li \l{Previewing on Devices} \li \l{Previewing in Browsers} \endlist - \li \l{Building for Multiple Platforms} \li \l{Deploying to Devices} \list \li \l{Deploying to Android} diff --git a/doc/qtcreator/src/qtcreator.qdoc b/doc/qtcreator/src/qtcreator.qdoc index ddc9b74cca6..0e8b476b40e 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}} @@ -52,10 +46,9 @@ \li \l{Writing Code} \li \l{Configuring the Editor} \endlist - \li \b {\l{Building and Running}} + \li \b {\l{Running on Devices}} \list \li \l{Validating with Target Hardware} - \li \l{Building for Multiple Platforms} \li \l{Deploying to Devices} \li \l{Connecting Devices} \endlist 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/user-interface/creator-ui.qdoc b/doc/qtcreator/src/user-interface/creator-ui.qdoc index 066e93fbbf6..88f57493534 100644 --- a/doc/qtcreator/src/user-interface/creator-ui.qdoc +++ b/doc/qtcreator/src/user-interface/creator-ui.qdoc @@ -50,7 +50,7 @@ \li \inlineimage numbers/05.png \li Build button \li Build the application using the selected kit. - \li \l{Building for Multiple Platforms} + \li \l{Build for many platforms} \row \li \inlineimage numbers/06.png \li Locator 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 0b0cbb0ee20..f5662a33fa9 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/qtcreator/src/webassembly/creator-webassembly.qdoc b/doc/qtcreator/src/webassembly/creator-webassembly.qdoc index e0ab35464c3..4a459e8cdd6 100644 --- a/doc/qtcreator/src/webassembly/creator-webassembly.qdoc +++ b/doc/qtcreator/src/webassembly/creator-webassembly.qdoc @@ -109,7 +109,7 @@ \endlist You can now build Qt applications in WebAssembly format and run them in - a web browser as described in \l {Building for Multiple Platforms} and + a web browser as described in \l {Build for many platforms} and \l{Run on many platforms}. \sa {Enable and disable plugins} 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 d0b451e6299..4ecc7f4cfdd 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -207,7 +207,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 4db25ba7494..3dff6c4f6fb 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -118,7 +118,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 9d4d7cc390f..a5c22bb8584 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..b399d86b36b 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"; } @@ -1933,7 +1934,7 @@ void Process::runBlocking(seconds timeout, EventLoopMode eventLoopMode) #endif } else { handleStart(); - if (!waitForFinished(timeout)) + if (state() != QProcess::NotRunning && !waitForFinished(timeout)) handleTimeout(); } if (blockingThresholdMs > 0) { 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 c6dc3b79435..211d184f732 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -223,8 +223,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 edc6033f9ae..ac7e50c0df9 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 8f2e5a944e7..04acf128801 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.cpp +++ b/src/plugins/cppeditor/cppcodestylesettingspage.cpp @@ -585,7 +585,7 @@ public: CppCodeStyleSettingsPageWidget() { CppCodeStylePreferences *originalCodeStylePreferences = CppToolsSettings::cppCodeStyle(); - m_pageCppCodeStylePreferences = new CppCodeStylePreferences(); + m_pageCppCodeStylePreferences.reset(new CppCodeStylePreferences); m_pageCppCodeStylePreferences->setDelegatingPool( originalCodeStylePreferences->delegatingPool()); m_pageCppCodeStylePreferences->setCodeStyleSettings( @@ -596,7 +596,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); @@ -626,7 +626,7 @@ public: m_codeStyleEditor->finish(); } - CppCodeStylePreferences *m_pageCppCodeStylePreferences = nullptr; + std::unique_ptr m_pageCppCodeStylePreferences; CodeStyleEditorWidget *m_codeStyleEditor; }; diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 3c290c76dd8..1aa77ae3ea3 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(); @@ -1762,6 +1765,10 @@ void DebuggerEngine::showMessage(const QString &msg, int channel, int timeout) c d->m_logWindow->showInput(LogInput, msg); d->m_logWindow->showOutput(LogInput, msg); break; + case LogOutput: + case LogWarning: + d->m_logWindow->showOutput(channel, msg); + break; case LogError: d->m_logWindow->showInput(LogError, "ERROR: " + msg); d->m_logWindow->showOutput(LogError, "ERROR: " + msg); @@ -1776,7 +1783,7 @@ void DebuggerEngine::showMessage(const QString &msg, int channel, int timeout) c emit appendMessageRequested(msg, StdErrFormat, false); break; default: - d->m_logWindow->showOutput(channel, msg); + d->m_logWindow->showOutput(channel, QString("[%1] %2").arg(debuggerName(), msg)); break; } } @@ -1794,6 +1801,9 @@ void DebuggerEngine::notifyDebuggerProcessFinished(const ProcessResultData &resu case DebuggerFinished: // Nothing to do. break; + case EngineSetupRequested: + notifyEngineSetupFailed(); + break; case EngineShutdownRequested: case InferiorShutdownRequested: notifyEngineShutdownFinished(); @@ -2011,11 +2021,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 7bfea271e5d..2e29b8dda82 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 c695f488b1f..9193a1ba372 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -1718,7 +1718,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/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 72c2ac4ae95..96f1e2a7b87 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -83,6 +83,8 @@ void QtSupportPlugin::initialize() addTestCreator(createQtProjectImporterTest); #endif + setupQtVersionManager(this); + setupDesktopQtVersion(); setupEmbeddedLinuxQtVersion(); setupGettingStartedWelcomePage(); diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 48edcca8c89..c269eca3cc5 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -89,7 +89,8 @@ static PersistentSettingsWriter *m_writer = nullptr; class QtVersionManagerImpl : public QObject { public: - QtVersionManagerImpl() + QtVersionManagerImpl(QObject *parent) + : QObject(parent) { qRegisterMetaType(); @@ -135,10 +136,18 @@ public: QTimer m_fileWatcherTimer; }; +static QObject *s_guard = nullptr; + +void Internal::setupQtVersionManager(QObject *guard) +{ + s_guard = guard; +} + QtVersionManagerImpl &qtVersionManagerImpl() { - static QtVersionManagerImpl theQtVersionManager; - return theQtVersionManager; + QTC_CHECK(s_guard); + static auto theQtVersionManager = new QtVersionManagerImpl(s_guard); + return *theQtVersionManager; } void QtVersionManagerImpl::triggerQtVersionRestore() diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index 9fa2cfb5b16..9eb17a4d8cc 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -70,4 +70,6 @@ private: static int getUniqueId(); }; +namespace Internal { void setupQtVersionManager(QObject *guard); } + } // namespace QtSupport 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);