forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/13.0' into qds/dev
Change-Id: I3adcadf18eb19344461c5a6a0b6d3aec9045430c
This commit is contained in:
@@ -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}"
|
||||||
|
2
dist/changelog/changes-13.0.0.md
vendored
2
dist/changelog/changes-13.0.0.md
vendored
@@ -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
|
||||||
-------
|
-------
|
||||||
|
BIN
doc/qtcreator/images/qtcreator-appman-deploy-settings.webp
Normal file
BIN
doc/qtcreator/images/qtcreator-appman-deploy-settings.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
doc/qtcreator/images/qtcreator-appman-kit-selector.webp
Normal file
BIN
doc/qtcreator/images/qtcreator-appman-kit-selector.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
BIN
doc/qtcreator/images/qtcreator-appman-run-settings.webp
Normal file
BIN
doc/qtcreator/images/qtcreator-appman-run-settings.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
@@ -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}
|
||||||
*/
|
*/
|
||||||
|
@@ -323,7 +323,7 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\sa {Detach views}
|
\sa {Analyzing CPU Usage}, {Detach views}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
154
doc/qtcreator/src/appman/creator-appman-how-to-run.qdoc
Normal file
154
doc/qtcreator/src/appman/creator-appman-how-to-run.qdoc
Normal 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}
|
||||||
|
*/
|
@@ -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
|
||||||
|
|
||||||
|
@@ -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}
|
||||||
*/
|
*/
|
||||||
|
@@ -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
|
||||||
|
@@ -65,16 +65,10 @@
|
|||||||
colleagues to review a change that you plan to submit to a
|
colleagues to review a change that you plan to submit to a
|
||||||
version control system.
|
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
|
\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
|
||||||
*/
|
*/
|
||||||
|
@@ -52,7 +52,7 @@
|
|||||||
To paste any content that you copied to the clipboard, select
|
To paste any content that you copied to the clipboard, select
|
||||||
\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 >
|
To fetch a snippet of code from the server, select \uicontrol Tools >
|
||||||
|
@@ -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.
|
||||||
@@ -47,30 +47,26 @@
|
|||||||
|
|
||||||
\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)
|
||||||
|
\section1 Paste changes for review
|
||||||
|
|
||||||
To send a chunk of changes to a \l{Pasting and Fetching Code Snippets}
|
To send a chunk of changes to a \l{Pasting and Fetching Code Snippets}
|
||||||
{code pasting service}, select \uicontrol {Send Chunk to CodePaster} in the
|
{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:
|
||||||
|
|
@@ -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}
|
||||||
*/
|
*/
|
||||||
|
@@ -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
|
||||||
|
*/
|
||||||
|
@@ -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
|
||||||
|
@@ -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)
|
||||||
|
@@ -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
|
|
||||||
*/
|
|
@@ -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
|
|
||||||
*/
|
*/
|
||||||
|
@@ -33,8 +33,6 @@
|
|||||||
\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{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}
|
\li \l{Using GitHub Copilot}
|
||||||
|
@@ -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}}
|
||||||
|
@@ -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
|
||||||
|
@@ -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
|
||||||
|
@@ -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
|
||||||
|
@@ -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
|
||||||
*/
|
*/
|
||||||
|
@@ -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 \
|
||||||
|
@@ -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
|
||||||
|
@@ -209,7 +209,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
|
||||||
|
@@ -117,7 +117,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
|
||||||
|
@@ -280,7 +280,11 @@ QTCREATOR_UTILS_EXPORT void createItem(Layouting::LayoutItem *item, const BaseAs
|
|||||||
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;
|
||||||
|
@@ -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);
|
||||||
|
@@ -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
|
|
@@ -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
|
|
@@ -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";
|
||||||
}
|
}
|
||||||
|
@@ -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)
|
||||||
|
@@ -222,8 +222,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",
|
||||||
|
@@ -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)
|
||||||
|
@@ -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);
|
||||||
|
@@ -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) {
|
||||||
|
const Dto::DashboardInfoDto &dashboardInfo = *unauthorizedDashboardStorage->dtoData;
|
||||||
|
const QString &username = settings().server.username;
|
||||||
|
if (username.isEmpty()
|
||||||
|
|| (dashboardInfo.username && *dashboardInfo.username == username)) {
|
||||||
dd->m_serverAccess = ServerAccess::NoAuthorization;
|
dd->m_serverAccess = ServerAccess::NoAuthorization;
|
||||||
dd->m_dashboardInfo = toDashboardInfo(*unauthorizedDashboardStorage);
|
dd->m_dashboardInfo = toDashboardInfo(*unauthorizedDashboardStorage);
|
||||||
} else {
|
return;
|
||||||
dd->m_serverAccess = ServerAccess::WithAuthorization;
|
|
||||||
}
|
}
|
||||||
return DoneResult::Success;
|
MessageManager::writeFlashing(QString("Axivion: %1")
|
||||||
|
.arg(Tr::tr("Unauthenticated access failed (wrong user), "
|
||||||
|
"using authenticated access...")));
|
||||||
|
}
|
||||||
|
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),
|
||||||
|
@@ -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();
|
||||||
});
|
});
|
||||||
|
@@ -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 {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
|
@@ -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"));
|
||||||
|
@@ -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)
|
||||||
|
@@ -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()
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
@@ -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);
|
||||||
|
@@ -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);
|
||||||
|
@@ -562,7 +562,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(
|
||||||
@@ -573,7 +573,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);
|
||||||
@@ -603,7 +603,7 @@ public:
|
|||||||
m_codeStyleEditor->finish();
|
m_codeStyleEditor->finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
CppCodeStylePreferences *m_pageCppCodeStylePreferences = nullptr;
|
std::unique_ptr<CppCodeStylePreferences> m_pageCppCodeStylePreferences;
|
||||||
CodeStyleEditorWidget *m_codeStyleEditor;
|
CodeStyleEditorWidget *m_codeStyleEditor;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -237,15 +237,6 @@ void CdbEngine::adjustOperateByInstruction(bool operateByInstruction)
|
|||||||
runCommand({QLatin1String(m_lastOperateByInstruction ? "l-t" : "l+t"), NoFlags});
|
runCommand({QLatin1String(m_lastOperateByInstruction ? "l-t" : "l+t"), NoFlags});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CdbEngine::canHandleToolTip(const DebuggerToolTipContext &context) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(context)
|
|
||||||
// Tooltips matching local variables are already handled in the
|
|
||||||
// base class. We don't handle anything else here in CDB
|
|
||||||
// as it can slow debugging down.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine full path to the CDB extension library.
|
// Determine full path to the CDB extension library.
|
||||||
QString CdbEngine::extensionLibraryName(bool is64Bit, bool isArm)
|
QString CdbEngine::extensionLibraryName(bool is64Bit, bool isArm)
|
||||||
{
|
{
|
||||||
|
@@ -26,8 +26,6 @@ public:
|
|||||||
explicit CdbEngine();
|
explicit CdbEngine();
|
||||||
~CdbEngine() override;
|
~CdbEngine() override;
|
||||||
|
|
||||||
bool canHandleToolTip(const DebuggerToolTipContext &context) const override;
|
|
||||||
|
|
||||||
void setupEngine() override;
|
void setupEngine() override;
|
||||||
void runEngine();
|
void runEngine();
|
||||||
void shutdownInferior() override;
|
void shutdownInferior() override;
|
||||||
|
@@ -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();
|
||||||
|
|
||||||
@@ -1794,6 +1797,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 +2017,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;
|
||||||
|
@@ -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())
|
||||||
|
@@ -478,13 +478,12 @@ void QmlEngine::gotoLocation(const Location &location)
|
|||||||
|
|
||||||
void QmlEngine::closeConnection()
|
void QmlEngine::closeConnection()
|
||||||
{
|
{
|
||||||
if (d->connectionTimer.isActive()) {
|
d->automaticConnect = false;
|
||||||
|
d->retryOnConnectFail = false;
|
||||||
d->connectionTimer.stop();
|
d->connectionTimer.stop();
|
||||||
} else {
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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
|
||||||
|
@@ -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);
|
||||||
|
@@ -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) {
|
||||||
|
@@ -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] {
|
||||||
|
@@ -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))
|
||||||
|
@@ -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);
|
||||||
|
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
@@ -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
|
||||||
|
@@ -1724,7 +1724,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
|
||||||
|
@@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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;
|
||||||
|
|
||||||
|
@@ -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(
|
||||||
|
@@ -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
|
||||||
|
@@ -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;
|
||||||
};
|
};
|
||||||
|
@@ -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();
|
||||||
|
@@ -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:
|
||||||
|
@@ -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
|
||||||
|
@@ -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()
|
||||||
|
@@ -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)
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user