Merge remote-tracking branch 'origin/13.0'

Conflicts:
	src/plugins/cmakeprojectmanager/cmaketool.cpp
	src/plugins/python/pythonutils.cpp
	src/plugins/qtsupport/baseqtversion.cpp

Change-Id: Ia3e35c763ff9475d17ad922718b54152209893b8
This commit is contained in:
Eike Ziller
2024-03-14 11:35:07 +01:00
97 changed files with 699 additions and 671 deletions

View File

@@ -330,7 +330,7 @@ function(add_qtc_plugin target_name)
cmake_parse_arguments(_arg cmake_parse_arguments(_arg
"SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT;SKIP_PCH" "SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT;SKIP_PCH"
"VERSION;COMPAT_VERSION;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT;PLUGIN_CLASS" "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} ${ARGN}
) )
@@ -421,6 +421,21 @@ function(add_qtc_plugin target_name)
" { \"Name\" : \"${i}\", \"Version\" : \"${_v}\", \"Type\" : \"test\" }" " { \"Name\" : \"${i}\", \"Version\" : \"${_v}\", \"Type\" : \"test\" }"
) )
endforeach(i) 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 {" string(REPLACE "} {" "},\n {"
_arg_DEPENDENCY_STRING "${_arg_DEPENDENCY_STRING}" _arg_DEPENDENCY_STRING "${_arg_DEPENDENCY_STRING}"

View File

@@ -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 deploying, running, and debugging for devices that use the
[Qt Application Manager](https://doc.qt.io/QtApplicationManager/). [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 General
------- -------

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -505,4 +505,6 @@
The \l {Application Output} view shows some information even if the The \l {Application Output} view shows some information even if the
Performance Analyzer displays error messages. Performance Analyzer displays error messages.
\sa {Profiling Function Execution}
*/ */

View File

@@ -323,7 +323,7 @@
\endlist \endlist
\sa {Detach views} \sa {Analyzing CPU Usage}, {Detach views}
*/ */
/*! /*!

View File

@@ -202,7 +202,7 @@
To start an AVD, select \uicontrol {Start AVD}. Usually, you don't need to To start an AVD, select \uicontrol {Start AVD}. Usually, you don't need to
start AVDs separately because \QC starts them when you 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. \l{Deploying to Android}{deploy applications} to them.
To remove an AVD from the list and the kit selector, select To remove an AVD from the list and the kit selector, select

View File

@@ -61,7 +61,7 @@
To remove the current deployment method, select \uicontrol Remove. To remove the current deployment method, select \uicontrol Remove.
\QC deploys the packages on the Android device that you select in the \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. \uicontrol Manage.
For more information about specifying additional start options for For more information about specifying additional start options for

View File

@@ -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}
*/

View File

@@ -262,7 +262,7 @@
You can build applications for and run them on bare metal devices 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 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} \sa {Enable and disable plugins}
*/ */

View File

@@ -145,8 +145,8 @@
To view all variables, select the \uicontrol Advanced check box. To view all variables, select the \uicontrol Advanced check box.
To view all variables by default, select \preferences > \uicontrol CMake > To view all variables by default, go to \preferences > \uicontrol CMake >
\uicontrol General > \uicontrol {Show advanced options by default}. \uicontrol General and select \uicontrol {Show advanced options by default}.
\image qtcreator-preferences-cmake-general.webp "General tab in CMake Preferences" \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 stored in the CMakeLists.txt.user file, so deleting a build directory
does not delete the initial configuration. does not delete the initial configuration.
To be asked before \QC resets the changes, select \preferences > To be asked before \QC resets the changes, go to \preferences >
\uicontrol CMake > \uicontrol General > \uicontrol CMake > \uicontrol General and select
\uicontrol {Ask before re-configuring with initial parameters}. \uicontrol {Ask before re-configuring with initial parameters}.
\section1 Viewing CMake Output \section1 Viewing CMake Output
@@ -268,16 +268,20 @@
\uicontrol Build > \uicontrol {Rebuild Project}. This cleans up the \uicontrol Build > \uicontrol {Rebuild Project}. This cleans up the
build directory and performs a new build. 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 To automatically set up the \l {Conan Package Manager}{Conan} or
CMake. \l {vcpkg Package Manager}{vcpkg} package manager for use with CMake:
Select \preferences > \uicontrol CMake \list 1
\uicontrol General > \uicontrol {Package manager auto setup} to set the \li Create a CMake script file that installs dependencies from a
value of the \c CMAKE_PROJECT_INCLUDE_BEFORE variable to the path to a \c conanfile.txt, \c conanfile.py, or \c vcpkg.json file in
CMake script that installs dependencies from a \c conanfile.txt, the project source directory.
\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 \section1 QTC_RUN Environment Variable
@@ -297,5 +301,5 @@
\sa {Activate kits for a project}, {Add custom output parsers}, \sa {Activate kits for a project}, {Add custom output parsers},
{Configure projects for building}, {Configure projects for running}, {Configure projects for building}, {Configure projects for running},
{Open projects}, {CMake} {Build with CMake}{How To: Build with CMake}, {Open projects}, {CMake}
*/ */

View File

@@ -47,8 +47,8 @@
Typically, you cannot compile such projects without manual changes. Typically, you cannot compile such projects without manual changes.
\endlist \endlist
\sa {Build with CMake}{How To: Build with CMake}, {CMake Build Configuration}, \sa {Configure projects for building}, {Configure projects for running},
{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}, {Debug CMake project files}, {Deploying to Remote Linux}, {Open projects},
{Use compilation databases} {Use compilation databases}
*/ */
@@ -70,9 +70,8 @@
\image qtcreator-projects-view-edit.png {CMake project in Projects view} \image qtcreator-projects-view-edit.png {CMake project in Projects view}
To disable this To disable this behavior, go to \preferences > \uicontrol CMake >
behavior, select \preferences > \uicontrol CMake > \uicontrol General, and \uicontrol General and clear \uicontrol {Autorun CMake}.
then deselect the \uicontrol {Autorun CMake} check box.
\image qtcreator-preferences-cmake-general.webp {General tab in CMake Preferences} \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 > box. The change takes effect after you select \uicontrol Build >
\uicontrol {Run CMake}. \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} {File System}, {Projects}
*/ */
@@ -125,7 +124,8 @@
\li Switching to the Help mode \li Switching to the Help mode
\endlist \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} \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}. Warnings and errors are displayed in \l {Issues}.
\sa {CMake}, {Add libraries to CMake projects}, {Complete CMake code}, \sa {Build with CMake}{How To: Build with CMake}, {CMake}, {Completion},
{Format CMake files}, {Completion}, {Snippets} {Snippets}
*/ */
/*! /*!
@@ -263,7 +264,8 @@
Press \key Tab or \key Enter to accept the selected suggestion and complete Press \key Tab or \key Enter to accept the selected suggestion and complete
the code. 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. current project.
\endlist \endlist
\sa {CMake},{Complete CMake code}, {Edit CMake configuration files}, \sa {Build with CMake}{How To: Build with CMake}, {Edit MIME types}, {CMake}
{Edit MIME types}
*/ */
/*! /*!
@@ -324,8 +325,7 @@
When you rename or remove files in the \l {Projects} or \l {File System} 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. view, \QC renames them in the CMakeLists.txt file or removes them from it.
\sa {CMake}, {Add libraries to CMake projects}, {Create files}, \sa {Create files}, {Build with CMake}{How To: Build with CMake}, {CMake},
{Edit CMake configuration files}, {View CMake project contents},
{File System}, {Projects} {File System}, {Projects}
*/ */
@@ -377,6 +377,6 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
\endcode \endcode
\sa {CMake}, {Edit CMake configuration files}, {Complete CMake code}, \sa {Build with CMake}{How To: Build with CMake}, {CMake}, {Completion},
{Completion}, {Snippets} {Snippets}
*/ */

View File

@@ -48,5 +48,5 @@
use with CMake. use with CMake.
\sa {Conan Build Configuration}, {Enable and disable plugins}, \sa {Conan Build Configuration}, {Enable and disable plugins},
{Using CMake with Conan} {Using CMake with Package Managers}
*/ */

View File

@@ -154,7 +154,7 @@
For \l {Creating a Qt for Python Application with Qt Widgets}{Python} projects, 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 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 \section1 Debugger Operating Modes
@@ -1992,7 +1992,7 @@
the right hand side to find out what went wrong. Always attach the the right hand side to find out what went wrong. Always attach the
contents of the pane to debugger-related questions to the \QC contents of the pane to debugger-related questions to the \QC
mailing list (qt-creator@qt-project.org) or paste them to a 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). 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. \note Error 135 usually means that a dependent DLL cannot be found.

View File

@@ -56,9 +56,5 @@
\endlist \endlist
\if defined(qtcreator)
\sa {Using GitHub Copilot}
\else
\sa {Apply quick fixes} \sa {Apply quick fixes}
\endif
*/ */

View File

@@ -49,11 +49,6 @@
\li Add, modify, and remove \l{Snippets}{code snippets} in \li Add, modify, and remove \l{Snippets}{code snippets} in
\uicontrol Snippets. \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. \li Configure \l{Completion}{code completion} in \uicontrol Completion.
\endlist \endlist

View File

@@ -57,24 +57,9 @@
few people can visualize the color \c {#18793f}. To easily edit few people can visualize the color \c {#18793f}. To easily edit
these properties, you can use the Qt Quick Toolbars. 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 \endlist
\if defined(qtcreator) \if defined(qtcreator)
\sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Comparing Files} \sa {Edit Code}{How To: Edit Code}, {Edit Mode}
\endif \endif
*/ */

View File

@@ -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 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*! /*!
\previouspage qt-quick-toolbars.html
\page creator-editor-codepasting.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 \title Paste and fetch code snippets
code from the server. To paste and fetch snippets of code, \QC uses the
following: 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 \list
\li \uicontrol {Pastebin.Com} \li \uicontrol {Pastebin.Com}
@@ -18,59 +18,72 @@
\li \uicontrol {Shared network drives} \li \uicontrol {Shared network drives}
\endlist \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 \section1 Paste snippets
\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
Select \uicontrol Fileshare to specify the path to a shared network drive. To paste a snippet of code onto the server, go to \uicontrol Tools >
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 >
\uicontrol {Code Pasting} > \uicontrol {Paste Snippet} or press \uicontrol {Code Pasting} > \uicontrol {Paste Snippet} or press
\key {Alt+C,Alt+P}. By default, \QC copies the URL of the snippet to the \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}. 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}. \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. chunk and select \uicontrol {Send Chunk to CodePaster} in the context menu.
To fetch a snippet of code from the server, select \uicontrol Tools > \section1 Fetch snippets
\uicontrol {Code Pasting} > \uicontrol {Fetch Snippet} or press
\key {Alt+C,Alt+F}. Select the snippet to fetch from the list.
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}. \uicontrol {Code Pasting} > \uicontrol {Fetch from URL}.
For example, you might ask colleagues to review a change that you plan to \section1 Set code pasting preferences
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 > To set preferences for a code pasting service:
\uicontrol Git > \uicontrol {Local Repository} > \uicontrol Diff. You can
then upload its contents to the server by selecting \uicontrol Tools > \list 1
\uicontrol {Code Pasting} > \uicontrol {Paste Snippet}. The reviewers can \li Go to \preferences > \uicontrol {Code Pasting} > \uicontrol General.
retrieve the code snippet by selecting \uicontrol Tools > \image qtcreator-code-pasting-options.png {Code Pasting preferences}
\uicontrol {Code Pasting} > \uicontrol {Fetch Snippet}. If they have the \li In \uicontrol {Default protocol}, select a code pasting service to
project currently opened in \QC, they can apply and test the change by use by default.
choosing \uicontrol Tools > \uicontrol Git > \uicontrol {Local Repository} \li In \uicontrol Username, enter your username.
> \uicontrol Patch > \uicontrol {Apply from Editor}. \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}
*/ */

View File

@@ -2,11 +2,12 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*! /*!
\previouspage creator-language-servers.html
\page creator-copilot.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 The Copilot plugin (disabled by default) integrates
\l{https://github.com/features/copilot}{GitHub Copilot} into \QC. \l{https://github.com/features/copilot}{GitHub Copilot} into \QC.
@@ -31,44 +32,43 @@
{Copilot.vim/Readme.md}. {Copilot.vim/Readme.md}.
\endlist \endlist
\section1 Setting Copilot Preferences \section1 Set Copilot preferences
To set preferences for using Copilot: To set preferences for using Copilot:
\list 1 \list 1
\li Select \preferences > \uicontrol Copilot. \li Go to \preferences > \uicontrol Copilot.
\image qtcreator-preferences-copilot.webp {Copilot tab in Preferences} \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 \li Select \uicontrol {Sign In} to sign into your subscription, activate
your device, and authorize the GitHub Copilot plugin. your device, and authorize the GitHub Copilot plugin.
The button turns into a \uicontrol {Sign Out} button. 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. 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. 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. 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. 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. proxy server.
\li In the \uicontrol {Proxy port} field, enter the port number of the \li Select \uicontrol {Reject unauthorized} to prevent the
proxy server.
\li Select the \uicontrol {Reject unauthorized} check box to prevent the
security risk presented by accepting unauthorized certificates from security risk presented by accepting unauthorized certificates from
the proxy server. 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. 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. password to authenticate to the proxy server.
\note The password is saved insecurely. \note The password is saved insecurely.
\li In the \uicontrol {Proxy password} field, enter the password to save. \li In \uicontrol {Proxy password}, enter the password to save.
To see the password as you type, select the \inlineimage icons/original-size.png To see the password as you type, select
button. \inlineimage icons/original-size.png.
\endlist \endlist
\section1 Receiving Suggestions \section1 Receive suggestions
When you write code in the \l {Edit Mode}{Edit} mode and When you write code in the \l {Edit Mode}{Edit} mode and
\uicontrol {Auto request} is enabled, Copilot automatically makes \uicontrol {Auto request} is enabled, Copilot automatically makes
@@ -93,20 +93,19 @@
To reject a suggestion, press \key Esc or the arrow keys. 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. projects or at project level for a particular project.
To enable or disable Copilot suggestions globally, select the To turn Copilot suggestions on or off globally, select
\inlineimage icons/copilot.png \inlineimage icons/copilot.png (\uicontrol {Toggle Copilot}). This also
(\uicontrol {Toggle Copilot}) button. This also sets the value of the sets the value of \uicontrol {Enable Copilot} in \preferences >
\uicontrol {Enable Copilot} check box in \preferences accordingly. \uicontrol Copilot accordingly.
To enable or disable Copilot suggestions for a particular project, To turn Copilot suggestions on or off for a particular project,
select \uicontrol Projects > \uicontrol {Project Settings} > go to \uicontrol Projects > \uicontrol {Project Settings} >
\uicontrol Copilot, and then select or deselect the \uicontrol Copilot and then select or clear \uicontrol {Enable Copilot}.
\uicontrol {Enable Copilot} check box.
\sa {Enable and disable plugins} \sa {Enable and disable plugins}, {Edit Mode}
*/ */

View File

@@ -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 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
// ********************************************************************** // **********************************************************************
@@ -9,31 +9,31 @@
/*! /*!
\page creator-diff-editor.html \page creator-diff-editor.html
\if defined(qtdesignstudio) \previouspage creator-how-tos.html
\previouspage qt-quick-toolbars.html
\nextpage studio-finding.html
\else
\previouspage creator-macros.html
\nextpage creator-clang-codemodel.html
\endif
\title Comparing Files \ingroup creator-how-to-edit
You can use a diff editor to display unsaved changes in the current file or \title Compare files
all open files or to compare any two text files that can be either versions
of the same file or arbitrary 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}. \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}. \uicontrol Diff > \uicontrol {Diff Open Files}.
\section1 Compare two files
To compare two files: To compare two files:
\list 1 \list 1
\li Select \uicontrol Tools > \uicontrol Diff > \li Go to \uicontrol Tools > \uicontrol Diff >
\uicontrol {Diff External Files}. \uicontrol {Diff External Files}.
\li Select two files to compare. \li Select two files to compare.
@@ -41,36 +41,32 @@
\endlist \endlist
To compare the currently opened file against another file in a project To compare the currently opened file against another file in a project
or the filesystem: or the file system:
\list 1 \list 1
\li Open the first file in an editor. \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 or \uicontrol {File System} view and select
\uicontrol {Diff Against Current File}. \uicontrol {Diff Against Current File}.
\endlist \endlist
If \QC cannot detect the encoding of the files to compare, an info bar 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}. 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 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 removed text (painted another shade of red) in the left pane and green
indicates lines that contain added text (painted another shade of green) indicates lines that contain added text (painted another shade of green)
in the right pane. 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 To view the differences in a unified view where changed rows are placed
below each other, select \inlineimage icons/unifieddiff.png below each other, select \inlineimage icons/unifieddiff.png
(\uicontrol {Switch to Unified Diff Editor}). (\uicontrol {Switch to Unified Diff Editor}).
@@ -85,22 +81,34 @@
show in \uicontrol {Context lines}. show in \uicontrol {Context lines}.
By default, the horizontal scroll bars in the left and right pane are 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 \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 If the files change outside \QC, select \inlineimage icons/reload_gray.png
(\uicontrol {Reload Editor}) to compare them again and to show the results. (\uicontrol {Reload Editor}) to compare them again and to show the results.
\if defined(qtcreator) \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 {code pasting service}, select \uicontrol {Send Chunk to CodePaster} in the
context menu. context menu.
\endif \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 \uicontrol {Text Editor} > \uicontrol {Font & Colors}. Create your own color
scheme and select new colors for the following items: scheme and select new colors for the following items:

View File

@@ -238,12 +238,13 @@
\image qtcreator-qml-js-editing.webp {QML/JS Editing preferences} \image qtcreator-qml-js-editing.webp {QML/JS Editing preferences}
When using \c qmlls from Qt 6.7 or later, it is recommended When using \c qmlls from Qt 6.7 or later, set \l{QT_QML_GENERATE_QMLLS_INI}
to set \l{QT_QML_GENERATE_QMLLS_INI} to \c{ON} in to \c{ON} in \uicontrol Projects > \uicontrol {Build Settings}
\uicontrol {Initial Configuration}. > \uicontrol {Initial Configuration}.
\sa {Manage Language Servers}{How To: Manage Language Servers}, \sa {Manage Language Servers}{How To: Manage Language Servers},
{Enabling and Disabling Messages}, {Language Servers} {Enabling and Disabling Messages}, {CMake Build Configuration},
{Language Servers}
*/ */
/*! /*!

View File

@@ -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 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*! /*!
\previouspage creator-editor-codepasting.html \previouspage creator-editor-codepasting.html
\page creator-macros.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 > \title Record text editing macros
\uicontrol {Text Editing Macros} > \uicontrol {Record Macro}
or press \key {Alt+[}. To stop recording, select \uicontrol Tools > When you have a file open in the code editor, you can record a
\uicontrol {Text Editing Macros} > \uicontrol {Stop Recording Macro} or keyboard sequence as a macro. You can then play the macro to
press \key {Alt+]}. 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. \note The macro recorder does not support code completion.
To play the last macro, select \uicontrol Tools > \section1 Play macros
\uicontrol {Text Editing Macros} > \uicontrol {Play Last Macro} or
press \key {Alt+R}.
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}. \uicontrol {Text Editing Macros} > \uicontrol {Save Last Macro}.
To assign a keyboard shortcut to a text editing macro, select To view and remove saved macros, go to \preferences >
\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 >
\uicontrol {Text Editor} > \uicontrol Macros. \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}
*/ */

View File

@@ -173,3 +173,11 @@
\externalpage https://developer.android.com/studio/install \externalpage https://developer.android.com/studio/install
\title Android Studio Installation Guide \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
*/

View File

@@ -45,5 +45,5 @@
{#qt-creator} channel on Libera.Chat IRC, go to \uicontrol Help > {#qt-creator} channel on Libera.Chat IRC, go to \uicontrol Help >
\uicontrol Contact. \uicontrol Contact.
\sa {Pasting and Fetching Code Snippets}, {Technical Support} \sa {Paste and fetch code snippets}, {Technical Support}
*/ */

View File

@@ -9,7 +9,8 @@
\title Connecting Boot2Qt Devices \title Connecting Boot2Qt Devices
You can connect \l{Boot2Qt} devices to the development PC to run, debug, 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 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 installed on the development PC, you can add it to \QC. You can then

View File

@@ -60,8 +60,7 @@
\li \l{Connecting Boot2Qt Devices} \li \l{Connecting Boot2Qt Devices}
\li \l{Boot2Qt Run Settings} \li \l{Boot2Qt Run Settings}
\li \l{Deploying to Boot2Qt} \li \l{Deploying to Boot2Qt}
\li \l{https://doc.qt.io/qtcreator/creator-overview-qtasam.html} \li \l{Run in Qt Application Manager}
{Qt Creator Plugin for Qt Application Manager}
\endlist \endlist
\section1 Remote Linux \section1 Remote Linux
@@ -77,8 +76,7 @@
\li \l{Deploying to Remote Linux} \li \l{Deploying to Remote Linux}
\li \l{Remote Linux Run Settings} \li \l{Remote Linux Run Settings}
\li \l{Run on remote Linux devices} \li \l{Run on remote Linux devices}
\li \l{https://doc.qt.io/qtcreator/creator-overview-qtasam.html} \li \l{Run in Qt Application Manager}
{Qt Creator Plugin for Qt Application Manager}
\endlist \endlist
\section1 Microcontroller Units (MCU) \section1 Microcontroller Units (MCU)

View File

@@ -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
*/

View File

@@ -81,22 +81,5 @@
\endlist \endlist
\section1 Related Topics \sa {Building Applications for the Web}, {Run in Qt Application Manager}
\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
*/ */

View File

@@ -39,7 +39,7 @@
In the \uicontrol {Tooltip in target selector} field, you can enter text 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 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 You can create separate versions of project files to keep platform-dependent
code separate. You can use qmake \l{Adding Platform Specific Source Files} code separate. You can use qmake \l{Adding Platform Specific Source Files}

View File

@@ -12,9 +12,7 @@
\page creator-building-running.html \page creator-building-running.html
\nextpage creator-live-preview.html \nextpage creator-live-preview.html
\title Building and Running \title Running on Devices
\image front-preview.png
\QC supports running and deploying Qt applications that you build \QC supports running and deploying Qt applications that you build
for different target platforms or with different compilers, debuggers, or for different target platforms or with different compilers, debuggers, or
@@ -31,12 +29,6 @@
Android and embedded Linux devices. The changes you make to Android and embedded Linux devices. The changes you make to
the UI are instantly visible to you in the preview. 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} \li \l{Deploying to Devices}
\e {Deploy configurations} handle the packaging and copying of \e {Deploy configurations} handle the packaging and copying of

View File

@@ -8,23 +8,26 @@
// ********************************************************************** // **********************************************************************
/*! /*!
\previouspage qt-design-viewer.html
\page creator-building-targets.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} 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 By default, when you run the application, you
automatically build and deploy it first. automatically build and deploy it first.
However, you can also perform each operation separately. However, you can also perform each operation separately.
To check that the application code can be compiled and linked for a device, 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 build the project. You can see build errors and warnings in \l Issues and
the \l Issues. More detailed information is displayed in \l {Compile Output}. more details in \l {Compile Output}.
\section1 Build an application
To build an application: To build an application:
@@ -37,7 +40,7 @@
\image qtcreator-kit-selector.webp {Kit selector} \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}. \key {Ctrl+B}.
Or, select \inlineimage icons/run_small.png (\uicontrol Run) to Or, select \inlineimage icons/run_small.png (\uicontrol Run) to
@@ -45,23 +48,25 @@
\endlist \endlist
\section1 Cancel builds
While the application is being built, the \inlineimage icons/build.png While the application is being built, the \inlineimage icons/build.png
(\uicontrol Build) button changes to a \inlineimage icons/cancel-build.png (\uicontrol Build) button changes to a \inlineimage icons/cancel-build.png
(\uicontrol {Cancel Build}) button. To cancel the build, select (\uicontrol {Cancel Build}) button. To cancel the build:
the button, press \key {Alt+Backspace}, or select \uicontrol Build >
\uicontrol {Cancel Build}.
If you selected a build command and \list
decide you would also like to run the application, you can select the \li Select \inlineimage icons/cancel-build.png.
\uicontrol Run button to schedule running the project after building is done. \li Press \key {Alt+Backspace}.
\li Go to \uicontrol Build > \uicontrol {Cancel Build}.
\endlist
For more information on the options you have, see If you selected a build command and now would also like to run the
\l{Specifying Build Settings}. 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, Go to \uicontrol Build to build, rebuild, and clean projects.
rebuilding, and cleaning projects.
To build the current project in all its configurations, that To build the current project in all its configurations, that
is, for all build configurations in all enabled kits, select is, for all build configurations in all enabled kits, select
@@ -74,20 +79,24 @@
To build all open projects in all their configurations, select To build all open projects in all their configurations, select
\uicontrol {Build All Projects for All Configurations}. \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 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, use the \uicontrol Build menu commands to build it. The available
subproject. The available build menu commands depend on the build system build menu commands depend on the build system you selected for the project:
you selected for the project: CMake, qmake, or Qbs. CMake, qmake, or Qbs.
Select \uicontrol {Build for Run Configuration} to Select \uicontrol {Build for Run Configuration} to
build the executable that corresponds to the selected run configuration. build the executable that corresponds to the selected run configuration.
You can also use the \c cm filter in the \l {Navigate with locator} You can also use the \c cm filter in the \l {Navigate with locator}
{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 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 To build and clean projects without dependencies, select the
\uicontrol {Build Without Dependencies}, \uicontrol {Build Without Dependencies},
@@ -95,30 +104,23 @@
\uicontrol {Clean Without Dependencies} options in the context menu in the \uicontrol {Clean Without Dependencies} options in the context menu in the
\uicontrol Projects view. \uicontrol Projects view.
To run qmake or CMake to regenerate build system files, select \sa {Configure projects for building}, {Build and Run}{How To: Build and Run},
\uicontrol Build > \uicontrol {Run qmake} or \uicontrol {Run CMake}. {Adding Docker Devices}, {Specifying Build Settings}
*/
\section1 Building with CMake
/*!
\QC automatically runs CMake when you make changes to \c {CMakeLists.txt} \page creator-how-to-run-qmake-before-building.html
files. To disable this feature, select \preferences > \uicontrol CMake > \previouspage creator-how-tos.html
\uicontrol General. Select the CMake executable to edit, and then deselect
the \uicontrol {Autorun CMake} check box. \ingroup creator-how-to-build-with-qmake
\image qtcreator-preferences-cmake-tools.webp "Tools tab in CMake Preferences" \title Run qmake before building
For more information, see \l {CMake}. To prevent failures on incremental builds, always run qmake before building,
even though it takes more time. Go to \preferences > \uicontrol {Build & Run}
\section1 Building with qmake > \uicontrol Qmake, and select \uicontrol {Run qmake on every build}.
To prevent failures on incremental builds, it might make sense \image qtcreator-preferences-build-run-qmake.png {Build & Run Qmake Preferences}
to always run qmake before building, even though it means that
building will take more time. To enable this option, select \preferences > \sa {Build and Run}{How To: Build and Run}, {qmake Build Configuration}
\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}
*/ */

View File

@@ -22,7 +22,7 @@
In the \uicontrol {Tooltip in target selector} field, you can enter text 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 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 You can enter a name for the build configuration in the
\uicontrol {Configuration name} field. \uicontrol {Configuration name} field.

View File

@@ -32,14 +32,10 @@
\li \l{Semantic Highlighting} \li \l{Semantic Highlighting}
\li \l{Checking Code Syntax} \li \l{Checking Code Syntax}
\li \l{Using Qt Quick Toolbars} \li \l{Using Qt Quick Toolbars}
\li \l{Pasting and Fetching Code Snippets}
\li \l{Using Text Editing Macros}
\li \l{Comparing Files}
\endlist \endlist
\li \l{Configuring the Editor} \li \l{Configuring the Editor}
\li \l{Using GitHub Copilot}
\endlist \endlist
\li \l{Building and Running} \li \l{Running on Devices}
\list \list
\li \l{Validating with Target Hardware} \li \l{Validating with Target Hardware}
\list \list
@@ -47,7 +43,6 @@
\li \l{Previewing on Devices} \li \l{Previewing on Devices}
\li \l{Previewing in Browsers} \li \l{Previewing in Browsers}
\endlist \endlist
\li \l{Building for Multiple Platforms}
\li \l{Deploying to Devices} \li \l{Deploying to Devices}
\list \list
\li \l{Deploying to Android} \li \l{Deploying to Android}

View File

@@ -25,12 +25,6 @@
to build applications in web format and run them in web to build applications in web format and run them in web
browsers. 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 \table
\row \row
\li {4,1} \b {\l{All Topics}{Click Here for a List of All Topics}} \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{Writing Code}
\li \l{Configuring the Editor} \li \l{Configuring the Editor}
\endlist \endlist
\li \b {\l{Building and Running}} \li \b {\l{Running on Devices}}
\list \list
\li \l{Validating with Target Hardware} \li \l{Validating with Target Hardware}
\li \l{Building for Multiple Platforms}
\li \l{Deploying to Devices} \li \l{Deploying to Devices}
\li \l{Connecting Devices} \li \l{Connecting Devices}
\endlist \endlist

View File

@@ -11,7 +11,7 @@
\page qt-quick-toolbars.html \page qt-quick-toolbars.html
\if defined(qtdesignstudio) \if defined(qtdesignstudio)
\previouspage creator-preferences-qtquick-code-style.html \previouspage creator-preferences-qtquick-code-style.html
\nextpage creator-diff-editor.html \nextpage studio-finding.html
\else \else
\previouspage creator-completing-code.html \previouspage creator-completing-code.html
\nextpage creator-editor-codepasting.html \nextpage creator-editor-codepasting.html

View File

@@ -83,8 +83,10 @@
new filename. new filename.
\li Remove existing files. \li Remove existing files.
\li Create new folders. \li Create new folders.
\if defined(qtcreator)
\li Compare the selected file with the currently open file in the diff \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 Display the contents of a particular directory in the view.
\li Collapse all open folders. \li Collapse all open folders.
\endlist \endlist

View File

@@ -50,7 +50,7 @@
\li \inlineimage numbers/05.png \li \inlineimage numbers/05.png
\li Build button \li Build button
\li Build the application using the selected kit. \li Build the application using the selected kit.
\li \l{Building for Multiple Platforms} \li \l{Build for many platforms}
\row \row
\li \inlineimage numbers/06.png \li \inlineimage numbers/06.png
\li Locator \li Locator

View File

@@ -142,7 +142,7 @@
\image qtcreator-vcs-diff.png \image qtcreator-vcs-diff.png
With Git, Mercurial, and Subversion, the diff is displayed side-by-side in 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 instead, select the \uicontrol {Switch to Text Diff Editor} (1) option from
the toolbar. In the inline the toolbar. In the inline
diff view, you can use context menu commands to apply, revert, stage, and diff view, you can use context menu commands to apply, revert, stage, and

View File

@@ -79,7 +79,7 @@
\image qtcreator-vcs-diff.png \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 the unified diff view instead, select the
\uicontrol {Switch to Unified Diff Editor} (1) option from the toolbar. \uicontrol {Switch to Unified Diff Editor} (1) option from the toolbar.
In both views, you can use context menu commands to apply, revert, stage, 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. visible only when you have merge conflicts to resolve.
\if defined(qtcreator) \if defined(qtcreator)
\sa {Set up version control systems}, {Version Control Systems} \sa {Compare files}, {Set up version control systems},
{Version Control Systems}
\endif \endif
*/ */

View File

@@ -109,7 +109,7 @@
\endlist \endlist
You can now build Qt applications in WebAssembly format and run them in 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}. \l{Run on many platforms}.
\sa {Enable and disable plugins} \sa {Enable and disable plugins}

View File

@@ -37,6 +37,7 @@ excludedirs += ../../qtcreator/examples/accelbubble \
../../qtcreator/examples/transitions \ ../../qtcreator/examples/transitions \
../../qtcreator/src/analyze \ ../../qtcreator/src/analyze \
../../qtcreator/src/android \ ../../qtcreator/src/android \
../../qtcreator/src/appman \
../../qtcreator/src/baremetal \ ../../qtcreator/src/baremetal \
../../qtcreator/src/cmake \ ../../qtcreator/src/cmake \
../../qtcreator/src/conan \ ../../qtcreator/src/conan \

View File

@@ -3,7 +3,7 @@
/*! /*!
\page studio-finding.html \page studio-finding.html
\previouspage creator-diff-editor.html \previouspage qt-quick-toolbars.html
\nextpage creator-editor-finding.html \nextpage creator-editor-finding.html
\title Finding \title Finding

View File

@@ -207,7 +207,6 @@
\li \l{Behavior} \li \l{Behavior}
\li \l{Qt Quick Code Style} \li \l{Qt Quick Code Style}
\li \l{Using Qt Quick Toolbars} \li \l{Using Qt Quick Toolbars}
\li \l{Comparing Files}
\endlist \endlist
\li \l{Finding} \li \l{Finding}
\list \list

View File

@@ -118,7 +118,6 @@ add_qtc_library(Utils
passworddialog.cpp passworddialog.h passworddialog.cpp passworddialog.h
pathchooser.cpp pathchooser.h pathchooser.cpp pathchooser.h
pathlisteditor.cpp pathlisteditor.h pathlisteditor.cpp pathlisteditor.h
persistentcachestore.cpp persistentcachestore.h
persistentsettings.cpp persistentsettings.h persistentsettings.cpp persistentsettings.h
pointeralgorithm.h pointeralgorithm.h
port.cpp port.h port.cpp port.h

View File

@@ -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);
QTCREATOR_UTILS_EXPORT void createItem(Layouting::LayoutItem *item, const BaseAspect *aspect); QTCREATOR_UTILS_EXPORT void createItem(Layouting::LayoutItem *item, const BaseAspect *aspect);
template <typename ValueType> template<typename ValueType>
class TypedAspect : public BaseAspect class
#ifndef Q_OS_WIN
QTCREATOR_UTILS_EXPORT
#endif
TypedAspect : public BaseAspect
{ {
public: public:
using valueType = ValueType; using valueType = ValueType;

View File

@@ -78,7 +78,7 @@ DetailsButton::DetailsButton(QWidget *parent)
QSize DetailsButton::sizeHint() const 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, return QSize(spacing + textSize.width() + spacing + 16 + spacing,
spacing + fontMetrics().height() + spacing); spacing + fontMetrics().height() + spacing);
} }
@@ -107,7 +107,7 @@ void DetailsButton::paintEvent(QPaintEvent *e)
qDrawPlainRect(&p, rect(), outlineColor()); qDrawPlainRect(&p, rect(), outlineColor());
const QRect textRect(spacing + 3, 0, width(), height()); 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()) { if (creatorTheme()->flag(Theme::FlatProjectsMode) || HostOsInfo::isMacHost()) {
const QRect iconRect(width() - spacing - 15, 0, 16, height()); const QRect iconRect(width() - spacing - 15, 0, 16, height());
icon().paint(&p, iconRect); icon().paint(&p, iconRect);

View File

@@ -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 <QMap>
#include <QMutex>
#include <QStandardPaths>
namespace Utils {
class PrivateGlobal
{
public:
QMutex mutex;
QMap<Key, Store> caches;
};
static expected_str<FilePath> cacheFolder()
{
static const FilePath folder = FilePath::fromUserInput(QStandardPaths::writableLocation(
QStandardPaths::CacheLocation))
/ "CachedStores";
static expected_str<void> created = folder.ensureWritableDir();
static expected_str<FilePath> result = created ? folder
: expected_str<FilePath>(
make_unexpected(created.error()));
QTC_ASSERT_EXPECTED(result, return result);
return result;
}
static PrivateGlobal &globals()
{
static PrivateGlobal global;
return global;
}
static expected_str<FilePath> filePathFromKey(const Key &cacheKey)
{
static const expected_str<FilePath> folder = cacheFolder();
if (!folder)
return folder;
return (*folder / FileUtils::fileSystemFriendlyName(stringFromKey(cacheKey))).withSuffix(".json");
}
expected_str<Store> PersistentCacheStore::byKey(const Key &cacheKey)
{
const expected_str<FilePath> 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<QByteArray> 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<void> PersistentCacheStore::write(const Key &cacheKey, const Store &store)
{
const expected_str<FilePath> 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<qint64> result = path->writeFileContents(json);
if (!result)
return make_unexpected(result.error());
return {};
}
expected_str<void> PersistentCacheStore::clear(const Key &cacheKey)
{
const expected_str<FilePath> 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

View File

@@ -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<Store> byKey(const Key &cacheKey);
static expected_str<void> write(const Key &cacheKey, const Store &store);
static expected_str<void> clear(const Key &cacheKey);
};
} // namespace Utils

View File

@@ -226,6 +226,7 @@ void DefaultImpl::start()
if (m_setup.m_runAsRoot && !HostOsInfo::isWindowsHost()) { if (m_setup.m_runAsRoot && !HostOsInfo::isWindowsHost()) {
arguments.prepend(program); arguments.prepend(program);
arguments.prepend("-E");
arguments.prepend("-A"); arguments.prepend("-A");
program = "sudo"; program = "sudo";
} }
@@ -1933,7 +1934,7 @@ void Process::runBlocking(seconds timeout, EventLoopMode eventLoopMode)
#endif #endif
} else { } else {
handleStart(); handleStart();
if (!waitForFinished(timeout)) if (state() != QProcess::NotRunning && !waitForFinished(timeout))
handleTimeout(); handleTimeout();
} }
if (blockingThresholdMs > 0) { if (blockingThresholdMs > 0) {

View File

@@ -11,6 +11,7 @@
#include <QCommonStyle> #include <QCommonStyle>
#include <QFileInfo> #include <QFileInfo>
#include <QFontDatabase> #include <QFontDatabase>
#include <QIcon>
#include <QPainter> #include <QPainter>
#include <QPainterPath> #include <QPainterPath>
#include <QPixmapCache> #include <QPixmapCache>
@@ -856,11 +857,7 @@ QString StyleHelper::dpiSpecificImageFile(const QString &fileName)
QString StyleHelper::imageFileWithResolution(const QString &fileName, int dpr) QString StyleHelper::imageFileWithResolution(const QString &fileName, int dpr)
{ {
const QFileInfo fi(fileName); return qt_findAtNxFile(fileName, dpr);
return dpr == 1 ? fileName :
fi.path() + QLatin1Char('/') + fi.completeBaseName()
+ QLatin1Char('@') + QString::number(dpr)
+ QLatin1String("x.") + fi.suffix();
} }
QList<int> StyleHelper::availableImageResolutions(const QString &fileName) QList<int> StyleHelper::availableImageResolutions(const QString &fileName)

View File

@@ -223,8 +223,6 @@ QtcLibrary {
"pathchooser.h", "pathchooser.h",
"pathlisteditor.cpp", "pathlisteditor.cpp",
"pathlisteditor.h", "pathlisteditor.h",
"persistentcachestore.cpp",
"persistentcachestore.h",
"persistentsettings.cpp", "persistentsettings.cpp",
"persistentsettings.h", "persistentsettings.h",
"pointeralgorithm.h", "pointeralgorithm.h",

View File

@@ -49,6 +49,7 @@ using namespace Utils;
namespace Android::Internal { namespace Android::Internal {
static Q_LOGGING_CATEGORY(androidsettingswidget, "qtc.android.androidsettingswidget", QtWarningMsg); static Q_LOGGING_CATEGORY(androidsettingswidget, "qtc.android.androidsettingswidget", QtWarningMsg);
constexpr int requiredJavaMajorVersion = 17;
class SummaryWidget : public QWidget class SummaryWidget : public QWidget
{ {
@@ -221,7 +222,6 @@ static expected_str<void> testJavaC(const FilePath &jdkPath)
const QString javacCommand("javac"); const QString javacCommand("javac");
const QString versionParameter("-version"); const QString versionParameter("-version");
constexpr int requiredMajorVersion = 17;
const FilePath bin = jdkPath / "bin" / (javacCommand + QTC_HOST_EXE_SUFFIX); const FilePath bin = jdkPath / "bin" / (javacCommand + QTC_HOST_EXE_SUFFIX);
if (!bin.isExecutableFile()) if (!bin.isExecutableFile())
@@ -254,9 +254,9 @@ static expected_str<void> testJavaC(const FilePath &jdkPath)
jdkVersion = QVersionNumber::fromString(stdOut.mid(outputPrefix.length()).split('\n').first()); 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)") return make_unexpected(Tr::tr("Unsupported JDK version (needs to be %1): %2 (parsed: %3)")
.arg(requiredMajorVersion) .arg(requiredJavaMajorVersion)
.arg(stdOut) .arg(stdOut)
.arg(jdkVersion.toString())); .arg(jdkVersion.toString()));
} }
@@ -692,10 +692,10 @@ void AndroidSettingsWidget::openNDKDownloadUrl()
void AndroidSettingsWidget::openOpenJDKDownloadUrl() void AndroidSettingsWidget::openOpenJDKDownloadUrl()
{ {
if (HostOsInfo::isLinuxHost()) const QString url =
QDesktopServices::openUrl(QUrl::fromUserInput("https://openjdk.java.net/install/")); QString::fromLatin1("https://adoptium.net/temurin/releases/?package=jdk&version=%1")
else .arg(requiredJavaMajorVersion);
QDesktopServices::openUrl(QUrl::fromUserInput("https://adoptopenjdk.net/")); QDesktopServices::openUrl(QUrl::fromUserInput(url));
} }
void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent) void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)

View File

@@ -349,6 +349,7 @@ IssuesWidget::IssuesWidget(QWidget *parent)
m_issuesView->setFrameShape(QFrame::StyledPanel); // Bring back Qt default m_issuesView->setFrameShape(QFrame::StyledPanel); // Bring back Qt default
m_issuesView->setFrameShadow(QFrame::Sunken); // Bring back Qt default m_issuesView->setFrameShadow(QFrame::Sunken); // Bring back Qt default
m_headerView = new IssueHeaderView(this); m_headerView = new IssueHeaderView(this);
m_headerView->setSectionsMovable(true);
connect(m_headerView, &IssueHeaderView::sortTriggered, connect(m_headerView, &IssueHeaderView::sortTriggered,
this, &IssuesWidget::onSearchParameterChanged); this, &IssuesWidget::onSearchParameterChanged);
m_issuesView->setHeader(m_headerView); m_issuesView->setHeader(m_headerView);

View File

@@ -402,7 +402,7 @@ static Group fetchHtmlRecipe(const QUrl &url, const std::function<void(const QBy
template <typename DtoType, template <typename> typename DtoStorageType> template <typename DtoType, template <typename> typename DtoStorageType>
static Group dtoRecipe(const Storage<DtoStorageType<DtoType>> &dtoStorage) static Group dtoRecipe(const Storage<DtoStorageType<DtoType>> &dtoStorage)
{ {
const Storage<QByteArray> storage; const Storage<std::optional<QByteArray>> storage;
const auto onNetworkQuerySetup = [dtoStorage](NetworkQuery &query) { const auto onNetworkQuerySetup = [dtoStorage](NetworkQuery &query) {
QNetworkRequest request(dtoStorage->url); QNetworkRequest request(dtoStorage->url);
@@ -451,7 +451,7 @@ static Group dtoRecipe(const Storage<DtoStorageType<DtoType>> &dtoStorage)
if constexpr (std::is_same_v<DtoType, Dto::DashboardInfoDto>) { if constexpr (std::is_same_v<DtoType, Dto::DashboardInfoDto>) {
// Suppress logging error on unauthorized dashboard fetch // Suppress logging error on unauthorized dashboard fetch
if (!dtoStorage->credential && error->type == "UnauthenticatedException") if (!dtoStorage->credential && error->type == "UnauthenticatedException")
return DoneResult::Error; return DoneResult::Success;
} }
errorString = Error(DashboardError(reply->url(), statusCode, errorString = Error(DashboardError(reply->url(), statusCode,
@@ -473,11 +473,15 @@ static Group dtoRecipe(const Storage<DtoStorageType<DtoType>> &dtoStorage)
}; };
const auto onDeserializeSetup = [storage](Async<expected_str<DtoType>> &task) { const auto onDeserializeSetup = [storage](Async<expected_str<DtoType>> &task) {
if (!*storage)
return SetupResult::StopWithSuccess;
const auto deserialize = [](QPromise<expected_str<DtoType>> &promise, const QByteArray &input) { const auto deserialize = [](QPromise<expected_str<DtoType>> &promise, const QByteArray &input) {
promise.addResult(DtoType::deserializeExpected(input)); promise.addResult(DtoType::deserializeExpected(input));
}; };
task.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer()); task.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
task.setConcurrentCallData(deserialize, *storage); task.setConcurrentCallData(deserialize, **storage);
return SetupResult::Continue;
}; };
const auto onDeserializeDone = [dtoStorage](const Async<expected_str<DtoType>> &task, const auto onDeserializeDone = [dtoStorage](const Async<expected_str<DtoType>> &task,
@@ -534,14 +538,21 @@ static Group authorizationRecipe()
unauthorizedDashboardStorage->url = QUrl(settings().server.dashboard); unauthorizedDashboardStorage->url = QUrl(settings().server.dashboard);
return SetupResult::Continue; return SetupResult::Continue;
}; };
const auto onUnauthorizedGroupDone = [unauthorizedDashboardStorage] { const auto onUnauthorizedDashboard = [unauthorizedDashboardStorage] {
if (unauthorizedDashboardStorage->dtoData) { if (unauthorizedDashboardStorage->dtoData) {
dd->m_serverAccess = ServerAccess::NoAuthorization; const Dto::DashboardInfoDto &dashboardInfo = *unauthorizedDashboardStorage->dtoData;
dd->m_dashboardInfo = toDashboardInfo(*unauthorizedDashboardStorage); const QString &username = settings().server.username;
} else { if (username.isEmpty()
dd->m_serverAccess = ServerAccess::WithAuthorization; || (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) { const auto onCredentialLoopCondition = [](int) {
@@ -649,7 +660,7 @@ static Group authorizationRecipe()
unauthorizedDashboardStorage, unauthorizedDashboardStorage,
onGroupSetup(onUnauthorizedGroupSetup), onGroupSetup(onUnauthorizedGroupSetup),
dtoRecipe(unauthorizedDashboardStorage), dtoRecipe(unauthorizedDashboardStorage),
onGroupDone(onUnauthorizedGroupDone) Sync(onUnauthorizedDashboard)
}, },
Group { Group {
LoopUntil(onCredentialLoopCondition), LoopUntil(onCredentialLoopCondition),

View File

@@ -44,6 +44,7 @@ void CredentialQueryTaskAdapter::start()
task()->m_errorString = job->errorString(); task()->m_errorString = job->errorString();
else if (reader && job->error() == NoError) else if (reader && job->error() == NoError)
task()->m_data = reader->binaryData(); task()->m_data = reader->binaryData();
disconnect(job, &Job::finished, this, nullptr);
emit done(toDoneResult(success)); emit done(toDoneResult(success));
m_guard.release()->deleteLater(); m_guard.release()->deleteLater();
}); });

View File

@@ -87,8 +87,13 @@ bool DynamicListModel::setData(const QModelIndex &index, const QVariant &value,
QVariant DynamicListModel::headerData(int section, Qt::Orientation orientation, int role) const 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); return m_header.at(section);
if (role == Qt::TextAlignmentRole)
return int(Qt::AlignLeft | Qt::AlignVCenter);
return {}; return {};
} }

View File

@@ -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 int margin = style()->pixelMetric(QStyle::PM_HeaderGripMargin, nullptr, this);
const QIcon icon = iconForSorted(logicalIndex == m_currentSortIndex ? m_currentSortOrder : SortOrder::None); const QIcon icon = iconForSorted(logicalIndex == m_currentSortIndex ? m_currentSortOrder : SortOrder::None);
const int offset = qMax((rect.height() - ICON_SIZE), 0) / 2; 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); icon.paint(painter, iconRect);
} }

View File

@@ -101,7 +101,7 @@ private:
QWidget *m_editorWidget = nullptr; QWidget *m_editorWidget = nullptr;
QScrollArea *m_editorScrollArea = nullptr; QScrollArea *m_editorScrollArea = nullptr;
TextEditor::SnippetEditorWidget *m_preview = nullptr; TextEditor::SnippetEditorWidget *m_preview = nullptr;
Core::IEditor *m_editor = nullptr; std::unique_ptr<Core::IEditor> m_editor;
std::unique_ptr<ClangFormatFile> m_config; std::unique_ptr<ClangFormatFile> m_config;
@@ -156,8 +156,7 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc
updatePreview(); updatePreview();
} }
void ClangFormatConfigWidget::slotCodeStyleChanged( void ClangFormatConfigWidget::slotCodeStyleChanged(TextEditor::ICodeStylePreferences *codeStyle)
TextEditor::ICodeStylePreferences *codeStyle)
{ {
if (!codeStyle) if (!codeStyle)
return; return;
@@ -177,7 +176,7 @@ void ClangFormatConfigWidget::initEditor(TextEditor::ICodeStylePreferences *code
Core::EditorFactories factories = Core::IEditorFactory::preferredEditorTypes( Core::EditorFactories factories = Core::IEditorFactory::preferredEditorTypes(
m_config->filePath()); m_config->filePath());
Core::IEditorFactory *factory = factories.takeFirst(); Core::IEditorFactory *factory = factories.takeFirst();
m_editor = factory->createEditor(); m_editor.reset(factory->createEditor());
QString errorString; QString errorString;
m_editor->document()->open(&errorString, m_config->filePath(), m_config->filePath()); m_editor->document()->open(&errorString, m_config->filePath(), m_config->filePath());
@@ -186,7 +185,7 @@ void ClangFormatConfigWidget::initEditor(TextEditor::ICodeStylePreferences *code
invokeMethodForLanguageClientManager("documentOpened", invokeMethodForLanguageClientManager("documentOpened",
Q_ARG(Core::IDocument *, m_editor->document())); Q_ARG(Core::IDocument *, m_editor->document()));
invokeMethodForLanguageClientManager("editorOpened", invokeMethodForLanguageClientManager("editorOpened",
Q_ARG(Core::IEditor *, m_editor)); Q_ARG(Core::IEditor *, m_editor.get()));
m_editorWidget = m_editor->widget(); m_editorWidget = m_editor->widget();
m_editorWidget->setEnabled(!codeStyle->isReadOnly() && !codeStyle->isTemporarilyReadOnly() 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); QShortcut *completionSC = new QShortcut(QKeySequence("Ctrl+Space"), this);
connect(completionSC, &QShortcut::activated, this, [this] { connect(completionSC, &QShortcut::activated, this, [this] {
if (auto *editor = qobject_cast<TextEditor::BaseTextEditor *>(m_editor)) if (auto *editor = qobject_cast<TextEditor::BaseTextEditor *>(m_editor.get()))
editor->editorWidget()->invokeAssist(TextEditor::Completion); editor->editorWidget()->invokeAssist(TextEditor::Completion);
}); });

View File

@@ -17,6 +17,7 @@
#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitaspects.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/taskhub.h>
#include <projectexplorer/toolchainmanager.h> #include <projectexplorer/toolchainmanager.h>
#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtkitaspect.h>
@@ -723,8 +724,14 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
if (!configurePreset.cmakeExecutable) { if (!configurePreset.cmakeExecutable) {
const CMakeTool *cmakeTool = CMakeToolManager::defaultCMakeTool(); const CMakeTool *cmakeTool = CMakeToolManager::defaultCMakeTool();
if (cmakeTool) if (cmakeTool) {
configurePreset.cmakeExecutable = cmakeTool->cmakeExecutable().toString(); configurePreset.cmakeExecutable = cmakeTool->cmakeExecutable().toString();
} else {
configurePreset.cmakeExecutable = QString();
TaskHub::addTask(
BuildSystemTask(Task::TaskType::Error, Tr::tr("<No CMake Tool available>")));
TaskHub::requestPopup();
}
} else { } else {
QString cmakeExecutable = configurePreset.cmakeExecutable.value(); QString cmakeExecutable = configurePreset.cmakeExecutable.value();
CMakePresets::Macros::expand(configurePreset, env, projectDirectory(), cmakeExecutable); CMakePresets::Macros::expand(configurePreset, env, projectDirectory(), cmakeExecutable);

View File

@@ -115,7 +115,7 @@ public:
CMakeTool cmake(m_autodetected ? CMakeTool::AutoDetection CMakeTool cmake(m_autodetected ? CMakeTool::AutoDetection
: CMakeTool::ManualDetection, m_id); : CMakeTool::ManualDetection, m_id);
cmake.setFilePath(m_executable); 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("Version: %1").arg(cmake.versionDisplay());
m_tooltip += "<br>" + Tr::tr("Supports fileApi: %1").arg(m_isSupported ? Tr::tr("yes") : Tr::tr("no")); m_tooltip += "<br>" + Tr::tr("Supports fileApi: %1").arg(m_isSupported ? Tr::tr("yes") : Tr::tr("no"));

View File

@@ -11,7 +11,6 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/persistentcachestore.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/temporarydirectory.h> #include <utils/temporarydirectory.h>
@@ -155,13 +154,13 @@ FilePath CMakeTool::filePath() const
return m_executable; return m_executable;
} }
bool CMakeTool::isValid(bool ignoreCache) const bool CMakeTool::isValid() const
{ {
if (!m_id.isValid() || !m_introspection) if (!m_id.isValid() || !m_introspection)
return false; return false;
if (!m_introspection->m_didAttemptToRun) if (!m_introspection->m_didAttemptToRun)
readInformation(ignoreCache); readInformation();
return m_introspection->m_haveCapabilitites && !m_introspection->m_fileApis.isEmpty(); return m_introspection->m_haveCapabilitites && !m_introspection->m_fileApis.isEmpty();
} }
@@ -324,9 +323,9 @@ CMakeKeywords CMakeTool::keywords()
return m_introspection->m_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 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))); Core::HelpManager::showHelpUrl(linkUrl.arg(documentationUrl(version, online)));
} }
void CMakeTool::readInformation(bool ignoreCache) const void CMakeTool::readInformation() const
{ {
QTC_ASSERT(m_introspection, return ); QTC_ASSERT(m_introspection, return );
if (!m_introspection->m_haveCapabilitites && m_introspection->m_didAttemptToRun) if (!m_introspection->m_haveCapabilitites && m_introspection->m_didAttemptToRun)
@@ -446,7 +445,7 @@ void CMakeTool::readInformation(bool ignoreCache) const
m_introspection->m_didAttemptToRun = true; m_introspection->m_didAttemptToRun = true;
fetchFromCapabilities(ignoreCache); fetchFromCapabilities();
} }
@@ -625,17 +624,8 @@ QStringList CMakeTool::parseSyntaxHighlightingXml()
return moduleFunctions; return moduleFunctions;
} }
void CMakeTool::fetchFromCapabilities(bool ignoreCache) const void CMakeTool::fetchFromCapabilities() const
{ {
expected_str<Utils::Store> cache = PersistentCacheStore::byKey(
keyFromString("CMake_" + cmakeExecutable().toUserOutput()));
if (cache && !ignoreCache) {
m_introspection->m_haveCapabilitites = true;
parseFromCapabilities(cache->value("CleanedStdOut").toString());
return;
}
Process cmake; Process cmake;
runCMake(cmake, {"-E", "capabilities"}); runCMake(cmake, {"-E", "capabilities"});
@@ -646,12 +636,6 @@ void CMakeTool::fetchFromCapabilities(bool ignoreCache) const
qCCritical(cmakeToolLog) << "Fetching capabilities failed: " << cmake.allOutput() << cmake.error(); qCCritical(cmakeToolLog) << "Fetching capabilities failed: " << cmake.allOutput() << cmake.error();
m_introspection->m_haveCapabilitites = false; 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) static int getVersion(const QVariantMap &obj, const QString &value)

View File

@@ -74,7 +74,7 @@ public:
static Utils::Id createId(); static Utils::Id createId();
bool isValid(bool ignoreCache = false) const; bool isValid() const;
Utils::Id id() const { return m_id; } Utils::Id id() const { return m_id; }
Utils::Store toMap () const; Utils::Store toMap () const;
@@ -91,7 +91,7 @@ public:
bool autoCreateBuildDirectory() const; bool autoCreateBuildDirectory() const;
QList<Generator> supportedGenerators() const; QList<Generator> supportedGenerators() const;
CMakeKeywords keywords(); CMakeKeywords keywords();
bool hasFileApi(bool ignoreCache = false) const; bool hasFileApi() const;
Version version() const; Version version() const;
QString versionDisplay() const; QString versionDisplay() const;
@@ -113,14 +113,14 @@ public:
static void openCMakeHelpUrl(const CMakeTool *tool, const QString &linkUrl); static void openCMakeHelpUrl(const CMakeTool *tool, const QString &linkUrl);
private: private:
void readInformation(bool ignoreCache = false) const; void readInformation() const;
void runCMake(Utils::Process &proc, const QStringList &args, int timeoutS = 1) const; void runCMake(Utils::Process &proc, const QStringList &args, int timeoutS = 1) const;
void parseFunctionDetailsOutput(const QString &output); void parseFunctionDetailsOutput(const QString &output);
QStringList parseVariableOutput(const QString &output); QStringList parseVariableOutput(const QString &output);
QStringList parseSyntaxHighlightingXml(); QStringList parseSyntaxHighlightingXml();
void fetchFromCapabilities(bool ignoreCache = false) const; void fetchFromCapabilities() const;
void parseFromCapabilities(const QString &input) const; void parseFromCapabilities(const QString &input) const;
// Note: New items here need also be handled in CMakeToolItemModel::apply() // Note: New items here need also be handled in CMakeToolItemModel::apply()

View File

@@ -301,9 +301,14 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
continue; continue;
const FilePath buildDir = relativeLibs ? buildDirectory : currentBuildDir; const FilePath buildDir = relativeLibs ? buildDirectory : currentBuildDir;
std::optional<QString> dllName; FilePath tmp = buildDir.resolvePath(part);
if (f.role == "libraries")
tmp = tmp.parentDir();
std::optional<QString> dllName;
if (buildDir.osType() == OsTypeWindows && (f.role == "libraries")) { 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 // Skip object libraries on Windows. This case can happen with static qml plugins
if (part.endsWith(".obj") || part.endsWith(".o")) if (part.endsWith(".obj") || part.endsWith(".o"))
continue; continue;
@@ -312,15 +317,17 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
for (const QString &suffix : for (const QString &suffix :
{QString(".lib"), QString(".dll.a"), QString(".a")}) { {QString(".lib"), QString(".dll.a"), QString(".a")}) {
if (part.endsWith(suffix) && !dllName) if (part.endsWith(suffix) && !dllName)
dllName = FilePath::fromUserInput( dllName = part.chopped(suffix.length()).append(".dll");
part.chopped(suffix.length()).append(".dll"))
.fileName();
} }
}
FilePath tmp = buildDir.resolvePath(part); // MinGW has libQt6Core.a -> Qt6Core.dll
if (f.role == "libraries") const QString mingwPrefix("lib");
tmp = tmp.parentDir(); 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()) { if (!tmp.isEmpty() && tmp.isDir()) {
// f.role is libraryPath or frameworkPath // f.role is libraryPath or frameworkPath
@@ -349,6 +356,7 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
} }
} }
ct.libraryDirectories = filteredUnique(librarySeachPaths); ct.libraryDirectories = filteredUnique(librarySeachPaths);
qCInfo(cmakeLogger) << "libraryDirectories for target" << ct.title << ":" << ct.libraryDirectories;
} }
return ct; return ct;
} }

View File

@@ -100,7 +100,7 @@ static const TextFormat &buttonTF(Button::Role role, WidgetState state)
using namespace WelcomePageHelpers; using namespace WelcomePageHelpers;
static const TextFormat mediumPrimaryTF static const TextFormat mediumPrimaryTF
{Theme::Token_Basic_White, StyleHelper::UiElement::UiElementButtonMedium, {Theme::Token_Basic_White, StyleHelper::UiElement::UiElementButtonMedium,
Qt::AlignCenter | Qt::TextDontClip}; Qt::AlignCenter | Qt::TextDontClip | Qt::TextShowMnemonic};
static const TextFormat mediumSecondaryTF static const TextFormat mediumSecondaryTF
{Theme::Token_Text_Default, mediumPrimaryTF.uiElement, mediumPrimaryTF.drawTextFlags}; {Theme::Token_Text_Default, mediumPrimaryTF.uiElement, mediumPrimaryTF.drawTextFlags};
static const TextFormat smallPrimaryTF static const TextFormat smallPrimaryTF
@@ -110,7 +110,7 @@ static const TextFormat &buttonTF(Button::Role role, WidgetState state)
{mediumSecondaryTF.themeColor, smallPrimaryTF.uiElement, smallPrimaryTF.drawTextFlags}; {mediumSecondaryTF.themeColor, smallPrimaryTF.uiElement, smallPrimaryTF.drawTextFlags};
static const TextFormat smallListDefaultTF static const TextFormat smallListDefaultTF
{Theme::Token_Text_Default, StyleHelper::UiElement::UiElementIconStandard, {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 smallListCheckedTF = smallListDefaultTF;
static const TextFormat smallLinkDefaultTF static const TextFormat smallLinkDefaultTF
{Theme::Token_Text_Default, StyleHelper::UiElement::UiElementIconStandard, {Theme::Token_Text_Default, StyleHelper::UiElement::UiElementIconStandard,
@@ -137,6 +137,8 @@ Button::Button(const QString &text, Role role, QWidget *parent)
, m_role(role) , m_role(role)
{ {
setText(text); setText(text);
setAttribute(Qt::WA_Hover);
updateMargins(); updateMargins();
if (m_role == SmallList) if (m_role == SmallList)
setCheckable(true); setCheckable(true);

View File

@@ -54,7 +54,8 @@ public:
const Utils::Theme::Color themeColor; const Utils::Theme::Color themeColor;
const Utils::StyleHelper::UiElement uiElement; 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); 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 cardDefaultBackground = Utils::Theme::Token_Background_Muted;
constexpr Utils::Theme::Color cardDefaultStroke = Utils::Theme::Token_Stroke_Subtle; constexpr Utils::Theme::Color cardDefaultStroke = Utils::Theme::Token_Stroke_Subtle;
constexpr Utils::Theme::Color cardHoverBackground = Utils::Theme::Token_Background_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, CORE_EXPORT void drawCardBackground(QPainter *painter, const QRectF &rect,
const QBrush &fill, const QPen &pen = QPen(Qt::NoPen), const QBrush &fill, const QPen &pen = QPen(Qt::NoPen),
qreal rounding = defaultCardBackgroundRounding); qreal rounding = defaultCardBackgroundRounding);

View File

@@ -585,7 +585,7 @@ public:
CppCodeStyleSettingsPageWidget() CppCodeStyleSettingsPageWidget()
{ {
CppCodeStylePreferences *originalCodeStylePreferences = CppToolsSettings::cppCodeStyle(); CppCodeStylePreferences *originalCodeStylePreferences = CppToolsSettings::cppCodeStyle();
m_pageCppCodeStylePreferences = new CppCodeStylePreferences(); m_pageCppCodeStylePreferences.reset(new CppCodeStylePreferences);
m_pageCppCodeStylePreferences->setDelegatingPool( m_pageCppCodeStylePreferences->setDelegatingPool(
originalCodeStylePreferences->delegatingPool()); originalCodeStylePreferences->delegatingPool());
m_pageCppCodeStylePreferences->setCodeStyleSettings( m_pageCppCodeStylePreferences->setCodeStyleSettings(
@@ -596,7 +596,7 @@ public:
m_pageCppCodeStylePreferences->setId(originalCodeStylePreferences->id()); m_pageCppCodeStylePreferences->setId(originalCodeStylePreferences->id());
m_codeStyleEditor = TextEditorSettings::codeStyleFactory(CppEditor::Constants::CPP_SETTINGS_ID) m_codeStyleEditor = TextEditorSettings::codeStyleFactory(CppEditor::Constants::CPP_SETTINGS_ID)
->createCodeStyleEditor(m_pageCppCodeStylePreferences); ->createCodeStyleEditor(m_pageCppCodeStylePreferences.get());
auto hbox = new QVBoxLayout(this); auto hbox = new QVBoxLayout(this);
hbox->addWidget(m_codeStyleEditor); hbox->addWidget(m_codeStyleEditor);
@@ -626,7 +626,7 @@ public:
m_codeStyleEditor->finish(); m_codeStyleEditor->finish();
} }
CppCodeStylePreferences *m_pageCppCodeStylePreferences = nullptr; std::unique_ptr<CppCodeStylePreferences> m_pageCppCodeStylePreferences;
CodeStyleEditorWidget *m_codeStyleEditor; CodeStyleEditorWidget *m_codeStyleEditor;
}; };

View File

@@ -1438,6 +1438,9 @@ void DebuggerEnginePrivate::updateState()
return; return;
QTC_ASSERT(m_threadLabel, return); QTC_ASSERT(m_threadLabel, return);
if (m_isDying)
return;
const DebuggerState state = m_state; const DebuggerState state = m_state;
const bool companionPreventsAction = m_engine->companionPreventsActions(); 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->showInput(LogInput, msg);
d->m_logWindow->showOutput(LogInput, msg); d->m_logWindow->showOutput(LogInput, msg);
break; break;
case LogOutput:
case LogWarning:
d->m_logWindow->showOutput(channel, msg);
break;
case LogError: case LogError:
d->m_logWindow->showInput(LogError, "ERROR: " + msg); d->m_logWindow->showInput(LogError, "ERROR: " + msg);
d->m_logWindow->showOutput(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); emit appendMessageRequested(msg, StdErrFormat, false);
break; break;
default: default:
d->m_logWindow->showOutput(channel, msg); d->m_logWindow->showOutput(channel, QString("[%1] %2").arg(debuggerName(), msg));
break; break;
} }
} }
@@ -1794,6 +1801,9 @@ void DebuggerEngine::notifyDebuggerProcessFinished(const ProcessResultData &resu
case DebuggerFinished: case DebuggerFinished:
// Nothing to do. // Nothing to do.
break; break;
case EngineSetupRequested:
notifyEngineSetupFailed();
break;
case EngineShutdownRequested: case EngineShutdownRequested:
case InferiorShutdownRequested: case InferiorShutdownRequested:
notifyEngineShutdownFinished(); notifyEngineShutdownFinished();
@@ -2011,11 +2021,16 @@ void DebuggerEngine::quitDebugger()
case EngineShutdownRequested: case EngineShutdownRequested:
case InferiorShutdownRequested: case InferiorShutdownRequested:
break; break;
case EngineRunFailed: case DebuggerNotReady:
case DebuggerFinished: case EngineSetupFailed:
case InferiorShutdownFinished: case InferiorShutdownFinished:
case EngineRunFailed:
case EngineShutdownFinished:
case DebuggerFinished:
break; break;
default: case InferiorRunRequested:
case InferiorRunFailed:
case InferiorStopRequested:
// FIXME: We should disable the actions connected to that. // FIXME: We should disable the actions connected to that.
notifyInferiorIll(); notifyInferiorIll();
break; break;

View File

@@ -28,6 +28,8 @@
#include <coreplugin/idocument.h> #include <coreplugin/idocument.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <projectexplorer/runcontrol.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <utils/processinterface.h> #include <utils/processinterface.h>
@@ -198,6 +200,11 @@ void LldbEngine::setupEngine()
environment.appendOrSet("PYTHONPATH", "/usr/lib/llvm-14/lib/python3.10/dist-packages"); 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); m_lldbProc.setEnvironment(environment);
if (runParameters().debugger.workingDirectory.isDir()) if (runParameters().debugger.workingDirectory.isDir())

View File

@@ -478,12 +478,11 @@ void QmlEngine::gotoLocation(const Location &location)
void QmlEngine::closeConnection() void QmlEngine::closeConnection()
{ {
if (d->connectionTimer.isActive()) { d->automaticConnect = false;
d->connectionTimer.stop(); d->retryOnConnectFail = false;
} else { d->connectionTimer.stop();
if (QmlDebugConnection *connection = d->connection()) if (QmlDebugConnection *connection = d->connection())
connection->close(); connection->close();
}
} }
void QmlEngine::startProcess() void QmlEngine::startProcess()
@@ -515,8 +514,8 @@ void QmlEngine::shutdownInferior()
d->runCommand({DISCONNECT}); d->runCommand({DISCONNECT});
resetLocation(); resetLocation();
stopProcess();
closeConnection(); closeConnection();
stopProcess();
notifyInferiorShutdownFinished(); notifyInferiorShutdownFinished();
} }
@@ -574,6 +573,10 @@ void QmlEngine::continueInferior()
void QmlEngine::interruptInferior() void QmlEngine::interruptInferior()
{ {
if (isDying()) {
notifyInferiorStopOk();
return;
}
showMessage(INTERRUPT, LogInput); showMessage(INTERRUPT, LogInput);
d->runDirectCommand(INTERRUPT); d->runDirectCommand(INTERRUPT);
showStatusMessage(Tr::tr("Waiting for JavaScript engine to interrupt on next statement.")); showStatusMessage(Tr::tr("Waiting for JavaScript engine to interrupt on next statement."));
@@ -948,6 +951,8 @@ Context QmlEngine::languageContext() const
void QmlEngine::disconnected() void QmlEngine::disconnected()
{ {
if (isDying())
return;
showMessage(Tr::tr("QML Debugger disconnected."), StatusBar); showMessage(Tr::tr("QML Debugger disconnected."), StatusBar);
notifyInferiorExited(); notifyInferiorExited();
} }
@@ -1122,6 +1127,8 @@ bool QmlEngine::isConnected() const
void QmlEngine::showConnectionStateMessage(const QString &message) void QmlEngine::showConnectionStateMessage(const QString &message)
{ {
if (isDying())
return;
showMessage("QML Debugger: " + message, LogStatus); showMessage("QML Debugger: " + message, LogStatus);
} }

View File

@@ -937,11 +937,6 @@ expected_str<void> DockerDevicePrivate::updateContainerAccess()
return {}; return {};
} }
if (QThread::currentThread() != thread()) {
expected_str<void> result;
return make_unexpected(Tr::tr("Cannot start docker device from non-main thread"));
}
if (m_isShutdown) if (m_isShutdown)
return make_unexpected(Tr::tr("Device is shut down")); return make_unexpected(Tr::tr("Device is shut down"));
@@ -949,14 +944,16 @@ expected_str<void> DockerDevicePrivate::updateContainerAccess()
return make_unexpected(Tr::tr("Docker system is not reachable")); return make_unexpected(Tr::tr("Docker system is not reachable"));
expected_str<void> result = startContainer(); expected_str<void> result = startContainer();
if (result) { QString containerStatus = result ? Tr::tr("Running") : result.error().trimmed();
deviceSettings->containerStatus.setText(Tr::tr("Running"));
return result;
}
const QString error = QString("Failed to start container: %1").arg(result.error()); if (!result)
deviceSettings->containerStatus.setText(result.error().trimmed()); result = make_unexpected(QString("Failed to start container: %1").arg(result.error()));
return make_unexpected(error);
QTimer::singleShot(0, this, [this, containerStatus] {
deviceSettings->containerStatus.setText(containerStatus);
});
return result;
} }
void DockerDevice::setMounts(const QStringList &mounts) const void DockerDevice::setMounts(const QStringList &mounts) const

View File

@@ -181,7 +181,7 @@ LanguageClientSettingsPageWidget::LanguageClientSettingsPageWidget(LanguageClien
this, &LanguageClientSettingsPageWidget::currentChanged); this, &LanguageClientSettingsPageWidget::currentChanged);
auto buttonLayout = new QVBoxLayout(); auto buttonLayout = new QVBoxLayout();
auto addButton = new QPushButton(Tr::tr("&Add")); auto addButton = new QPushButton(Tr::tr("&Add"));
auto addMenu = new QMenu; auto addMenu = new QMenu(this);
addMenu->clear(); addMenu->clear();
for (const ClientType &type : clientTypes()) { for (const ClientType &type : clientTypes()) {
auto action = new QAction(type.name); auto action = new QAction(type.name);

View File

@@ -81,7 +81,7 @@ McuKitCreationDialog::McuKitCreationDialog(const MessagesList &messages,
if (messages.empty()) { if (messages.empty()) {
fixButton->setVisible(false); fixButton->setVisible(false);
m_informationLabel->setText( m_informationLabel->setText(
QCoreApplication::translate("QtC::Autotest", "No errors detected")); QCoreApplication::translate("QtC::Autotest", "No errors detected."));
} }
if (messages.size() < 2) { if (messages.size() < 2) {

View File

@@ -77,7 +77,7 @@ private:
DeviceManager * const m_deviceManager; DeviceManager * const m_deviceManager;
DeviceManagerModel * const m_deviceManagerModel; DeviceManagerModel * const m_deviceManagerModel;
QList<QPushButton *> m_additionalActionButtons; QList<QPushButton *> m_additionalActionButtons;
IDeviceWidget *m_configWidget; IDeviceWidget *m_configWidget = nullptr;
QLabel *m_configurationLabel; QLabel *m_configurationLabel;
QComboBox *m_configurationComboBox; QComboBox *m_configurationComboBox;
@@ -97,7 +97,6 @@ private:
DeviceSettingsWidget::DeviceSettingsWidget() DeviceSettingsWidget::DeviceSettingsWidget()
: m_deviceManager(DeviceManager::cloneInstance()) : m_deviceManager(DeviceManager::cloneInstance())
, m_deviceManagerModel(new DeviceManagerModel(m_deviceManager, this)) , m_deviceManagerModel(new DeviceManagerModel(m_deviceManager, this))
, m_configWidget(nullptr)
{ {
m_configurationLabel = new QLabel(Tr::tr("&Device:")); m_configurationLabel = new QLabel(Tr::tr("&Device:"));
m_configurationComboBox = new QComboBox; m_configurationComboBox = new QComboBox;
@@ -116,7 +115,7 @@ DeviceSettingsWidget::DeviceSettingsWidget()
connect(addButton, &OptionPushButton::clicked, this, &DeviceSettingsWidget::addDevice); connect(addButton, &OptionPushButton::clicked, this, &DeviceSettingsWidget::addDevice);
QMenu *deviceTypeMenu = new QMenu(addButton); 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); connect(defaultAction, &QAction::triggered, this, &DeviceSettingsWidget::addDevice);
deviceTypeMenu->addAction(defaultAction); deviceTypeMenu->addAction(defaultAction);
deviceTypeMenu->addSeparator(); deviceTypeMenu->addSeparator();
@@ -128,7 +127,7 @@ DeviceSettingsWidget::DeviceSettingsWidget()
continue; continue;
//: Add <Device Type Name> //: Add <Device Type Name>
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); deviceTypeMenu->addAction(action);
connect(action, &QAction::triggered, this, [factory, this] { connect(action, &QAction::triggered, this, [factory, this] {

View File

@@ -465,7 +465,6 @@ void Project::removeAllVanishedTargets()
Target *Project::createKitAndTargetFromStore(const Utils::Store &store) Target *Project::createKitAndTargetFromStore(const Utils::Store &store)
{ {
const Id id = idFromMap(store);
Id deviceTypeId = Id::fromSetting(store.value(Target::deviceTypeKey())); Id deviceTypeId = Id::fromSetting(store.value(Target::deviceTypeKey()));
if (!deviceTypeId.isValid()) if (!deviceTypeId.isValid())
deviceTypeId = Constants::DESKTOP_DEVICE_TYPE; deviceTypeId = Constants::DESKTOP_DEVICE_TYPE;
@@ -478,8 +477,7 @@ Target *Project::createKitAndTargetFromStore(const Utils::Store &store)
kit->setUnexpandedDisplayName(kitName); kit->setUnexpandedDisplayName(kitName);
DeviceTypeKitAspect::setDeviceTypeId(kit, deviceTypeId); DeviceTypeKitAspect::setDeviceTypeId(kit, deviceTypeId);
kit->setup(); kit->setup();
}, });
id);
QTC_ASSERT(k, return nullptr); QTC_ASSERT(k, return nullptr);
auto t = std::make_unique<Target>(this, k, Target::_constructor_tag{}); auto t = std::make_unique<Target>(this, k, Target::_constructor_tag{});
if (!t->fromMap(store)) if (!t->fromMap(store))

View File

@@ -196,7 +196,7 @@ ProjectExplorerSettingsWidget::ProjectExplorerSettingsWidget()
m_jomCheckbox->setVisible(HostOsInfo::isWindowsHost()); m_jomCheckbox->setVisible(HostOsInfo::isWindowsHost());
jomLabel->setVisible(HostOsInfo::isWindowsHost()); jomLabel->setVisible(HostOsInfo::isWindowsHost());
m_directoryButtonGroup = new QButtonGroup; m_directoryButtonGroup = new QButtonGroup(this);
m_directoryButtonGroup->setExclusive(true); m_directoryButtonGroup->setExclusive(true);
m_directoryButtonGroup->addButton(m_currentDirectoryRadioButton, UseCurrentDirectory); m_directoryButtonGroup->addButton(m_currentDirectoryRadioButton, UseCurrentDirectory);
m_directoryButtonGroup->addButton(m_directoryRadioButton, UseProjectDirectory); m_directoryButtonGroup->addButton(m_directoryRadioButton, UseProjectDirectory);

View File

@@ -307,7 +307,7 @@ public:
StaticTreeItem *parentForToolChain(Toolchain *tc); StaticTreeItem *parentForToolChain(Toolchain *tc);
QAction *createAction(const QString &name, ToolchainFactory *factory, Utils::Id language) 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, connect(action, &QAction::triggered, this,
[this, factory, language] { createToolChain(factory, language); }); [this, factory, language] { createToolChain(factory, language); });
return action; return action;

View File

@@ -419,6 +419,7 @@ public:
, m_mainGroup(new QGroupBox(Tr::tr("Use Python Language Server"))) , m_mainGroup(new QGroupBox(Tr::tr("Use Python Language Server")))
{ {
m_editor->setParent(this);
m_mainGroup->setCheckable(true); m_mainGroup->setCheckable(true);
auto mainGroupLayout = new QVBoxLayout; auto mainGroupLayout = new QVBoxLayout;

View File

@@ -19,7 +19,6 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/mimeutils.h> #include <utils/mimeutils.h>
#include <utils/persistentcachestore.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <QReadLocker> #include <QReadLocker>
@@ -201,20 +200,10 @@ static bool isUsableHelper(QHash<FilePath, bool> *cache, const QString &keyStrin
auto it = cache->find(python); auto it = cache->find(python);
if (it == cache->end()) { if (it == cache->end()) {
const Key key = keyFromString(keyString); 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 process;
process.setCommand({python, QStringList{"-m", commandArg, "-h"}}); process.setCommand({python, QStringList{"-m", commandArg, "-h"}});
process.runBlocking(); process.runBlocking();
const bool usable = process.result() == ProcessResult::FinishedWithSuccess; 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); it = cache->insert(python, usable);
} }
return *it; return *it;

View File

@@ -478,6 +478,7 @@ add_qtc_plugin(QmlDesigner
PLUGIN_DEPENDS PLUGIN_DEPENDS
Core ProjectExplorer QmlDesignerBase QmlJSEditor QmakeProjectManager QmlProjectManager Core ProjectExplorer QmlDesignerBase QmlJSEditor QmakeProjectManager QmlProjectManager
QtSupport QtSupport
PLUGIN_MANUAL_DEPENDS LicenseChecker ${IDE_VERSION} optional
DEPENDS DEPENDS
QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem
Qt::QuickWidgets Qt::CorePrivate Qt::Xml Qt::Svg QmlDesignerCore Sqlite Qt::QuickWidgets Qt::CorePrivate Qt::Xml Qt::Svg QmlDesignerCore Sqlite

View File

@@ -1718,7 +1718,7 @@ bool NodeMetaInfo::hasProperty(Utils::SmallStringView propertyName) const
if constexpr (useProjectStorage()) if constexpr (useProjectStorage())
return isValid() && bool(propertyId(*m_projectStorage, m_typeId, propertyName)); return isValid() && bool(propertyId(*m_projectStorage, m_typeId, propertyName));
else else
return isValid() && m_privateData->properties().contains(propertyName); return isValid() && m_privateData->properties().contains(QByteArrayView(propertyName));
} }
PropertyMetaInfos NodeMetaInfo::properties() const PropertyMetaInfos NodeMetaInfo::properties() const

View File

@@ -199,7 +199,7 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent)
previewFileAction->setVisible(fileNode && fileNode->fileType() == FileType::QML); previewFileAction->setVisible(fileNode && fileNode->fileType() == FileType::QML);
}); });
connect(Core::EditorManager::instance(), &Core::EditorManager::editorOpened, this, connect(Core::EditorManager::instance(), &Core::EditorManager::editorOpened, this,
[runPreviewAction] (Core::IEditor *editor) { [] (Core::IEditor *editor) {
if (!editor) if (!editor)
return; return;
if (!editor->document()) if (!editor->document())
@@ -225,8 +225,8 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent)
{":/utils/images/run_small.png", Utils::Theme::IconsRunToolBarColor}, {":/utils/images/run_small.png", Utils::Theme::IconsRunToolBarColor},
{":/utils/images/eyeoverlay.png", Utils::Theme::IconsDebugColor} {":/utils/images/eyeoverlay.png", Utils::Theme::IconsDebugColor}
}).icon(); }).icon();
Utils::ProxyAction *action = Utils::ProxyAction *action = Utils::ProxyAction::proxyActionWithIcon(
Utils::ProxyAction::proxyActionWithIcon(runPreviewAction, icon); Core::ActionManager::command("QmlPreview.RunPreview")->action(), icon);
toolBar->insertAction(nullptr, action); toolBar->insertAction(nullptr, action);
}); });

View File

@@ -116,9 +116,9 @@ Store QnxQtVersion::toMap() const
return result; 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))); setSdpPath(FilePath::fromSettings(map.value(SDP_PATH_KEY)));
} }

View File

@@ -28,9 +28,7 @@ public:
QString cpuDir() const; QString cpuDir() const;
Utils::Store toMap() const override; Utils::Store toMap() const override;
void fromMap(const Utils::Store &map, void fromMap(const Utils::Store &map, const Utils::FilePath &filePath) override;
const Utils::FilePath &filePath,
bool forceRefreshCache) override;
ProjectExplorer::Abis detectQtAbis() const override; ProjectExplorer::Abis detectQtAbis() const override;

View File

@@ -74,7 +74,8 @@ AppManagerInstallPackageStep::AppManagerInstallPackageStep(BuildStepList *bsl, I
const TargetInformation targetInformation(target()); 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); packageFile.setDefaultPathValue(targetInformation.packageFilePath);
} else { } else {
const Utils::FilePath packageFilePath = targetInformation.runDirectory.pathAppended( const Utils::FilePath packageFilePath = targetInformation.runDirectory.pathAppended(

View File

@@ -33,7 +33,6 @@
#include <utils/fileinprojectfinder.h> #include <utils/fileinprojectfinder.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/macroexpander.h> #include <utils/macroexpander.h>
#include <utils/persistentcachestore.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/stringutils.h> #include <utils/stringutils.h>
@@ -250,19 +249,6 @@ static QSet<Id> versionedIds(const QVersionNumber &version)
version.majorVersion(), version.minorVersion()); version.majorVersion(), version.minorVersion());
} }
// Wrapper to make the std::unique_ptr<Utils::MacroExpander> "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<MacroExpander> m_expander;
};
enum HostBinaries { Designer, Linguist, Rcc, Uic, QScxmlc }; enum HostBinaries { Designer, Linguist, Rcc, Uic, QScxmlc };
class QtVersionPrivate class QtVersionPrivate
@@ -330,19 +316,9 @@ public:
FilePath m_qmlRuntimePath; FilePath m_qmlRuntimePath;
FilePath m_qmlplugindumpPath; FilePath m_qmlplugindumpPath;
MacroExpanderWrapper m_expander; std::unique_ptr<MacroExpander> 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 } // Internal
/////////////// ///////////////
@@ -741,7 +717,7 @@ bool QtVersion::hasReleaseBuild() const
return !d->m_defaultConfigIsDebug || d->m_defaultConfigIsDebugAndRelease; 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(); 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 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); d->m_qmakeCommand = filePath.resolvePath(d->m_qmakeCommand);
const expected_str<Utils::Store> 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); Store::const_iterator itQtAbis = map.find(QTVERSION_ABIS);
if (itQtAbis != map.end()) { if (itQtAbis != map.end()) {
// Only the SDK Tool writes abis to the settings. If we find abis in the settings, we want // 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()); 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; return result;
} }
@@ -1419,9 +1384,6 @@ void QtVersionPrivate::updateVersionInfo()
m_isUpdating = false; m_isUpdating = false;
m_data.versionInfoUpToDate = true; m_data.versionInfoUpToDate = true;
PersistentCacheStore::write(Key("QtVersionData" + m_qmakeCommand.toString().toUtf8()),
m_data.toMap());
} }
QHash<ProKey,ProString> QtVersionPrivate::versionInfo() QHash<ProKey,ProString> QtVersionPrivate::versionInfo()
@@ -1504,7 +1466,9 @@ FilePaths QtVersion::qtSoPaths() const
MacroExpander *QtVersion::macroExpander() 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<MacroExpander> std::unique_ptr<MacroExpander>
@@ -2463,13 +2427,13 @@ QtVersion *QtVersionFactory::create() const
return version; return version;
} }
QtVersion *QtVersion::clone(bool forceRefreshCache) const QtVersion *QtVersion::clone() const
{ {
for (QtVersionFactory *factory : std::as_const(g_qtVersionFactories)) { for (QtVersionFactory *factory : std::as_const(g_qtVersionFactories)) {
if (factory->m_supportedType == d->m_type) { if (factory->m_supportedType == d->m_type) {
QtVersion *version = factory->create(); QtVersion *version = factory->create();
QTC_ASSERT(version, return nullptr); 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. // 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 // The auto detection is not perfect, and we always want to use the data provided by

View File

@@ -49,9 +49,7 @@ public:
virtual ~QtVersion(); virtual ~QtVersion();
virtual void fromMap(const Utils::Store &map, virtual void fromMap(const Utils::Store &map, const Utils::FilePath &filePath = {});
const Utils::FilePath &filePath = {},
bool forceRefreshCache = false);
virtual bool equals(QtVersion *other); virtual bool equals(QtVersion *other);
bool isAutodetected() const; bool isAutodetected() const;
@@ -223,7 +221,7 @@ private:
friend class Internal::QtSettingsPageWidget; friend class Internal::QtSettingsPageWidget;
void setId(int id); void setId(int id);
QtVersion *clone(bool forceRefreshCache = false) const; QtVersion *clone() const;
Internal::QtVersionPrivate *d = nullptr; Internal::QtVersionPrivate *d = nullptr;
}; };

View File

@@ -454,8 +454,10 @@ bool ExamplesViewController::isVisible() const
void ExampleSetModel::updateQtVersionList() void ExampleSetModel::updateQtVersionList()
{ {
QtVersions versions = QtVersionManager::sortVersions(QtVersionManager::versions( QtVersions versions = QtVersionManager::sortVersions(
[](const QtVersion *v) { return v->hasExamples() || v->hasDemos(); })); QtVersionManager::versions([](const QtVersion *v) {
return !v->qmakeFilePath().needsDevice() && (v->hasExamples() || v->hasDemos());
}));
// prioritize default qt version // prioritize default qt version
ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit(); ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit();

View File

@@ -602,7 +602,7 @@ void QtSettingsPageWidget::updateQtVersions(const QList<int> &additions, const Q
// Add changed/added items: // Add changed/added items:
for (int a : std::as_const(toAdd)) { 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); auto *item = new QtVersionItem(version);
// Insert in the right place: // Insert in the right place:

View File

@@ -83,6 +83,8 @@ void QtSupportPlugin::initialize()
addTestCreator(createQtProjectImporterTest); addTestCreator(createQtProjectImporterTest);
#endif #endif
setupQtVersionManager(this);
setupDesktopQtVersion(); setupDesktopQtVersion();
setupEmbeddedLinuxQtVersion(); setupEmbeddedLinuxQtVersion();
setupGettingStartedWelcomePage(); setupGettingStartedWelcomePage();

View File

@@ -89,7 +89,8 @@ static PersistentSettingsWriter *m_writer = nullptr;
class QtVersionManagerImpl : public QObject class QtVersionManagerImpl : public QObject
{ {
public: public:
QtVersionManagerImpl() QtVersionManagerImpl(QObject *parent)
: QObject(parent)
{ {
qRegisterMetaType<FilePath>(); qRegisterMetaType<FilePath>();
@@ -135,10 +136,18 @@ public:
QTimer m_fileWatcherTimer; QTimer m_fileWatcherTimer;
}; };
static QObject *s_guard = nullptr;
void Internal::setupQtVersionManager(QObject *guard)
{
s_guard = guard;
}
QtVersionManagerImpl &qtVersionManagerImpl() QtVersionManagerImpl &qtVersionManagerImpl()
{ {
static QtVersionManagerImpl theQtVersionManager; QTC_CHECK(s_guard);
return theQtVersionManager; static auto theQtVersionManager = new QtVersionManagerImpl(s_guard);
return *theQtVersionManager;
} }
void QtVersionManagerImpl::triggerQtVersionRestore() void QtVersionManagerImpl::triggerQtVersionRestore()

View File

@@ -70,4 +70,6 @@ private:
static int getUniqueId(); static int getUniqueId();
}; };
namespace Internal { void setupQtVersionManager(QObject *guard); }
} // namespace QtSupport } // namespace QtSupport

View File

@@ -43,6 +43,7 @@
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QMessageBox> #include <QMessageBox>
#include <QMutex> #include <QMutex>
#include <QPointer>
#include <QReadWriteLock> #include <QReadWriteLock>
#include <QRegularExpression> #include <QRegularExpression>
#include <QTemporaryDir> #include <QTemporaryDir>
@@ -865,7 +866,10 @@ public:
void closeShell() void closeShell()
{ {
m_shell.reset(); if (QObject *shell = m_shell.get()) {
m_shell = nullptr;
shell->deleteLater();
}
} }
// Call me with shell mutex locked // Call me with shell mutex locked
@@ -881,10 +885,10 @@ public:
<< m_displaylessSshParameters.host()); << m_displaylessSshParameters.host());
cmd.addArg("/bin/sh"); cmd.addArg("/bin/sh");
m_shell.reset(new LinuxDeviceShell(cmd, m_shell = new LinuxDeviceShell(cmd,
FilePath::fromString(QString("ssh://%1/").arg(parameters.userAtHostAndPort())))); FilePath::fromString(QString("ssh://%1/").arg(parameters.userAtHostAndPort())));
connect(m_shell.get(), &DeviceShell::done, this, [this] { connect(m_shell.get(), &DeviceShell::done, this, [this] {
m_shell.release()->deleteLater(); closeShell();
}); });
auto result = m_shell->start(); auto result = m_shell->start();
if (!result) { if (!result) {
@@ -981,7 +985,7 @@ private:
mutable QMutex m_mutex; mutable QMutex m_mutex;
SshParameters m_displaylessSshParameters; SshParameters m_displaylessSshParameters;
QList<SshSharedConnection *> m_connections; QList<SshSharedConnection *> m_connections;
std::unique_ptr<LinuxDeviceShell> m_shell; QPointer<LinuxDeviceShell> m_shell;
}; };
// LinuxDevice // LinuxDevice

View File

@@ -330,8 +330,6 @@ void GenericLinuxDeviceTester::testDevice(const IDevice::Ptr &deviceConfiguratio
d->m_device = std::static_pointer_cast<LinuxDevice>(deviceConfiguration); d->m_device = std::static_pointer_cast<LinuxDevice>(deviceConfiguration);
d->m_connectionTest = new QFutureWatcher<bool>(this); d->m_connectionTest = new QFutureWatcher<bool>(this);
d->m_connectionTest->setFuture(d->m_device->tryToConnect());
connect(d->m_connectionTest, &QFutureWatcher<bool>::finished, this, [this] { connect(d->m_connectionTest, &QFutureWatcher<bool>::finished, this, [this] {
const bool success = d->m_connectionTest->result(); const bool success = d->m_connectionTest->result();
d->m_connectionTest->deleteLater(); d->m_connectionTest->deleteLater();
@@ -345,6 +343,7 @@ void GenericLinuxDeviceTester::testDevice(const IDevice::Ptr &deviceConfiguratio
emit finished(TestFailure); emit finished(TestFailure);
} }
}); });
d->m_connectionTest->setFuture(d->m_device->tryToConnect());
} }
void GenericLinuxDeviceTester::stopTest() void GenericLinuxDeviceTester::stopTest()

View File

@@ -280,9 +280,10 @@ void TerminalWidget::setupActions()
pasteAction.addOnTriggered(this, &TerminalWidget::pasteFromClipboard); pasteAction.addOnTriggered(this, &TerminalWidget::pasteFromClipboard);
m_paste = make_registered(pasteAction); m_paste = make_registered(pasteAction);
ActionBuilder closeAction(this, Core::Constants::CLOSE); ActionBuilder(this, Core::Constants::CLOSE)
closeAction.setContext(m_context); .setContext(m_context)
closeAction.addOnTriggered(this, &TerminalWidget::closeTerminal); .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. // 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); ActionBuilder clearTerminalAction(this, Constants::CLEAR_TERMINAL);
@@ -689,9 +690,6 @@ void TerminalWidget::initActions(QObject *parent)
moveCursorWordRightAction.setText(Tr::tr("Move Cursor Word Right")); moveCursorWordRightAction.setText(Tr::tr("Move Cursor Word Right"));
moveCursorWordRightAction.setContext(context); moveCursorWordRightAction.setContext(context);
moveCursorWordRightAction.setDefaultKeySequence({QKeySequence("Alt+Right")}); moveCursorWordRightAction.setDefaultKeySequence({QKeySequence("Alt+Right")});
ActionBuilder closeAction(parent, Core::Constants::CLOSE);
closeAction.setText(Tr::tr("Close Terminal"));
} }
void TerminalWidget::unlockGlobalAction(const Utils::Id &commandId) void TerminalWidget::unlockGlobalAction(const Utils::Id &commandId)

View File

@@ -139,7 +139,7 @@ public:
const QPixmap croppedLogo = logo.copy(cropR); const QPixmap croppedLogo = logo.copy(cropR);
const int lineHeight = welcomeTF.lineHeight(); const int lineHeight = welcomeTF.lineHeight();
const QPixmap scaledCroppedLogo = const QPixmap scaledCroppedLogo =
croppedLogo.scaledToHeight((lineHeight - 12) * devicePixelRatioF(), croppedLogo.scaledToHeight((lineHeight - 12) * croppedLogo.devicePixelRatioF(),
Qt::SmoothTransformation); Qt::SmoothTransformation);
ideIconLabel->setPixmap(scaledCroppedLogo); ideIconLabel->setPixmap(scaledCroppedLogo);
ideIconLabel->setFixedHeight(lineHeight); ideIconLabel->setFixedHeight(lineHeight);