Merge "Merge remote-tracking branch 'origin/12.0' into qds/dev" into qds/dev

This commit is contained in:
The Qt Project
2023-11-09 09:24:26 +00:00
104 changed files with 721 additions and 319 deletions

View File

@@ -145,6 +145,12 @@ Editing
### QML ### QML
* Fixed multiple crashes when updating the `Outline` view
([QTCREATORBUG-28862](https://bugreports.qt.io/browse/QTCREATORBUG-28862),
[QTCREATORBUG-29653](https://bugreports.qt.io/browse/QTCREATORBUG-29653),
[QTCREATORBUG-29702](https://bugreports.qt.io/browse/QTCREATORBUG-29702))
* Fixed that reformatting QML code removed type annotations
([QTCREATORBUG-29061](https://bugreports.qt.io/browse/QTCREATORBUG-29061))
* Fixed invalid `M325` warnings * Fixed invalid `M325` warnings
([QTCREATORBUG-29601](https://bugreports.qt.io/browse/QTCREATORBUG-29601)) ([QTCREATORBUG-29601](https://bugreports.qt.io/browse/QTCREATORBUG-29601))
* Language Server * Language Server
@@ -237,6 +243,8 @@ Projects
* Fixed issues with the subdirectory structure of the project tree * Fixed issues with the subdirectory structure of the project tree
([QTCREATORBUG-23942](https://bugreports.qt.io/browse/QTCREATORBUG-23942), ([QTCREATORBUG-23942](https://bugreports.qt.io/browse/QTCREATORBUG-23942),
[QTCREATORBUG-29105](https://bugreports.qt.io/browse/QTCREATORBUG-29105)) [QTCREATORBUG-29105](https://bugreports.qt.io/browse/QTCREATORBUG-29105))
* Fixed an issue with source file specific compiler flags
([QTCREATORBUG-29707](https://bugreports.qt.io/browse/QTCREATORBUG-29707))
* Presets * Presets
* Fixed that variables were not expanded for `cmakeExecutable` * Fixed that variables were not expanded for `cmakeExecutable`
([QTCREATORBUG-29643](https://bugreports.qt.io/browse/QTCREATORBUG-29643)) ([QTCREATORBUG-29643](https://bugreports.qt.io/browse/QTCREATORBUG-29643))
@@ -258,12 +266,19 @@ Projects
* Fixed the project tree structure in case of some subfolder structures * Fixed the project tree structure in case of some subfolder structures
([QTCREATORBUG-29733](https://bugreports.qt.io/browse/QTCREATORBUG-29733)) ([QTCREATORBUG-29733](https://bugreports.qt.io/browse/QTCREATORBUG-29733))
### Qbs
* Fixed the importing of builds on macOS
([QTCREATORBUG-29829](https://bugreports.qt.io/browse/QTCREATORBUG-29829))
### vcpkg ### vcpkg
* Added the generation of code for `CMakeLists.txt` * Added the generation of code for `CMakeLists.txt`
* Added parsing the dependencies from `vcpkg.json` manifest files * Added parsing the dependencies from `vcpkg.json` manifest files
* Improved the addition of dependencies to `vcpkg.json` * Improved the addition of dependencies to `vcpkg.json`
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-edit-vcpkg-manifest-files.html))
### Qt Safe Renderer ### Qt Safe Renderer
* Added a wizard for Qt Safe Renderer 2.1 and later * Added a wizard for Qt Safe Renderer 2.1 and later
@@ -277,6 +292,11 @@ Debugging
* Added support for remote Linux debugging with LLDB * Added support for remote Linux debugging with LLDB
* Fixed warnings about index cache permissions * Fixed warnings about index cache permissions
([QTCREATORBUG-29556](https://bugreports.qt.io/browse/QTCREATORBUG-29556)) ([QTCREATORBUG-29556](https://bugreports.qt.io/browse/QTCREATORBUG-29556))
* Pretty Printers
* Fixed `QDateTime` with a time zone offset
([QTCREATORBUG-29737](https://bugreports.qt.io/browse/QTCREATORBUG-29737))
* Fixed `std::unique_ptr` on macOS
* Fixed `QImage`
Analyzer Analyzer
-------- --------
@@ -323,10 +343,17 @@ Test Integration
* Added an option for the number of threads used for scanning * Added an option for the number of threads used for scanning
([QTCREATORBUG-29301](https://bugreports.qt.io/browse/QTCREATORBUG-29301)) ([QTCREATORBUG-29301](https://bugreports.qt.io/browse/QTCREATORBUG-29301))
* Improved the wizards for `GTest` and `Catch2` * Improved the wizards for `GTest` and `Catch2`
* CTest
* Enabled colored test output
Platforms Platforms
--------- ---------
### macOS
* Fixed running and debugging in an external terminal
([QTCREATORBUG-29246](https://bugreports.qt.io/browse/QTCREATORBUG-29246))
### Android ### Android
* Fixed issues when `LIBRARY_OUTPUT_DIRECTORY` is set in the CMake build files * Fixed issues when `LIBRARY_OUTPUT_DIRECTORY` is set in the CMake build files

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -59,8 +59,9 @@
\section1 Specifying Settings for Debug Server Providers \section1 Specifying Settings for Debug Server Providers
To create connections to bare metal devices using a debug server provider, To create connections to bare metal devices using a debug server provider,
select \preferences > \uicontrol Devices select \preferences > \uicontrol Devices > \uicontrol {Bare Metal} >
> \uicontrol {Bare Metal} > \uicontrol Add > \uicontrol Default. \uicontrol Add.
The available settings depend on the debug server provider. The available settings depend on the debug server provider.
\section2 EBlink \section2 EBlink
@@ -68,7 +69,7 @@
\l{https://github.com/EmBitz/EBlink}{EBlink} is an ARM Cortex-M debug tool \l{https://github.com/EmBitz/EBlink}{EBlink} is an ARM Cortex-M debug tool
that supports squirrel scripting, live variables, and hot-plugging. that supports squirrel scripting, live variables, and hot-plugging.
\image qtcreator-baremetal-eblink.png "Bare metal device preferences for EBlink" \image qtcreator-baremetal-eblink.webp {Bare metal device preferences for EBlink}
To specify settings for \EBlink: To specify settings for \EBlink:
@@ -105,7 +106,7 @@
\l{https://www.segger.com/products/debug-probes/j-link/}{J-Link} is a line \l{https://www.segger.com/products/debug-probes/j-link/}{J-Link} is a line
of debug probes by Segger. of debug probes by Segger.
\image qtcreator-baremetal-jlink.png "Bare metal device preferences for J-Link" \image qtcreator-baremetal-jlink.webp "Bare metal device preferences for J-Link"
To specify settings for J-Link debug probes: To specify settings for J-Link debug probes:
@@ -137,7 +138,7 @@
(JTAG) facility. It enables source level debugging with the GDB compiled (JTAG) facility. It enables source level debugging with the GDB compiled
for the ARM architecture. for the ARM architecture.
\image qtcreator-baremetal-openocd.png "Bare metal device preferences for OpenOCD" \image qtcreator-baremetal-openocd.webp "Bare metal device preferences for OpenOCD"
To specify settings for \OpenOCD: To specify settings for \OpenOCD:
@@ -163,7 +164,7 @@
\l{https://www.st.com/en/development-tools/stm32-programmers.html#products} \l{https://www.st.com/en/development-tools/stm32-programmers.html#products}
{ST-LINK Utility} is used for programming STM32 microcontrollers. {ST-LINK Utility} is used for programming STM32 microcontrollers.
\image qtcreator-baremetal-stlink.png "Bare metal device preferences for St-Link" \image qtcreator-baremetal-stlink.webp "Bare metal device preferences for St-Link"
To specify settings for St-Link: To specify settings for St-Link:
@@ -202,7 +203,7 @@
\image qtcreator-baremetal-uvision-simulator.png "Bare metal device preferences for uVision Simulator" \image qtcreator-baremetal-uvision-simulator.png "Bare metal device preferences for uVision Simulator"
To specify settings for uVision Simulator or uVision St-Link Debugger: To specify settings for uVision Simulator:
\list 1 \list 1
@@ -215,11 +216,11 @@
\endlist \endlist
\section3 uVision St-Link Debugger \section3 uVision St-Link or JLink Debugger
\image qtcreator-baremetal-uvision-st-link.png "Bare metal device preferences for uVision St-Link" \image qtcreator-baremetal-uvision-st-link.png "Bare metal device preferences for uVision St-Link"
To specify settings for uVision St-Link Debugger: To specify settings for uVision St-Link or JLink Debugger:
\list 1 \list 1

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2023 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
//! [baremetal-common] //! [baremetal-common]
@@ -6,6 +6,8 @@
\li In the \uicontrol Name field, enter a name for the connection. \li In the \uicontrol Name field, enter a name for the connection.
\li In the \uicontrol {Startup mode} field, select the mode to start \li In the \uicontrol {Startup mode} field, select the mode to start
the debug server provider in. the debug server provider in.
\li In the \uicontrol {Peripheral description file} field, specify a path to
a file that describes the peripherals on the device.
\li In the \uicontrol Host field, select the host name and port number \li In the \uicontrol Host field, select the host name and port number
to connect to the debug server provider. to connect to the debug server provider.
\li In the \uicontrol {Executable file} field, enter the path to the \li In the \uicontrol {Executable file} field, enter the path to the

View File

@@ -88,7 +88,8 @@
the selection, click anywhere in the view. the selection, click anywhere in the view.
To change the environment variable values for the CMake build environment, To change the environment variable values for the CMake build environment,
select \uicontrol {Batch Edit}. For more information, see \l{Batch Editing}. select \uicontrol {Batch Edit}. For more information, see
\l{Batch edit environment settings}.
To build using the current configuration, select \uicontrol {Run CMake}. To build using the current configuration, select \uicontrol {Run CMake}.
While building, the button text changes to \uicontrol {Stop CMake}. Select While building, the button text changes to \uicontrol {Stop CMake}. Select

View File

@@ -53,7 +53,7 @@
To specify settings for managing the GDB process, select \preferences > To specify settings for managing the GDB process, select \preferences >
\uicontrol Debugger > \uicontrol GDB. \uicontrol Debugger > \uicontrol GDB.
\image qtcreator-gdb-options.png "GDB preferences" \image qtcreator-preferences-debugger-gdb.webp {GDB preferences}
To specify a timeout for terminating non-responsive GDB processes, set the To specify a timeout for terminating non-responsive GDB processes, set the
number of seconds to wait in the \uicontrol {GDB timeout} field. The default number of seconds to wait in the \uicontrol {GDB timeout} field. The default
@@ -111,6 +111,8 @@
To execute arbitrary Python scripts, use To execute arbitrary Python scripts, use
\c {python execfile('/path/to/script.py')}. \c {python execfile('/path/to/script.py')}.
\section2 Extended GDB Settings
The settings in the \uicontrol Extended group give access to advanced The settings in the \uicontrol Extended group give access to advanced
or experimental functions of GDB. or experimental functions of GDB.
Enabling them may negatively impact your debugging experience, so use Enabling them may negatively impact your debugging experience, so use

View File

@@ -1368,7 +1368,7 @@
\uicontrol Debugger > \uicontrol GDB > \uicontrol {Load system GDB pretty \uicontrol Debugger > \uicontrol GDB > \uicontrol {Load system GDB pretty
printers}. For more information, see \l{Specifying GDB Settings}. printers}. For more information, see \l{Specifying GDB Settings}.
\image qtcreator-gdb-options.png {GDB preferences} \image qtcreator-preferences-debugger-gdb.webp {GDB preferences}
\section2 Customizing Built-In Debugging Helpers \section2 Customizing Built-In Debugging Helpers
@@ -2036,7 +2036,7 @@
when loading the same binary in the future. Select \preferences > when loading the same binary in the future. Select \preferences >
\uicontrol Debugger > \uicontrol GDB > \uicontrol {Use automatic symbol cache}. \uicontrol Debugger > \uicontrol GDB > \uicontrol {Use automatic symbol cache}.
\image qtcreator-gdb-options.png {GDB preferences} \image qtcreator-preferences-debugger-gdb.webp {GDB preferences}
\section2 Minimizing Number of Breakpoints \section2 Minimizing Number of Breakpoints

View File

@@ -197,12 +197,13 @@
\if defined(qtcreator) \if defined(qtcreator)
Also specify a text string or C++ or QML code construct Also specify a text string or C++ or QML code construct
in the snippet editor, depending on the snippet category. in the snippet editor, depending on the snippet category.
You can use \l{Use Qt Creator variables}{predefined variables} in
snippets.
\else \else
Also specify a text string or QML code in the snippet editor, depending on Also specify a text string or QML code in the snippet editor, depending on
the snippet category. the snippet category.
\endif \endif
You can use \l{Using Qt Creator Variables}{predefined variables} in
snippets.
The snippet editor offers: The snippet editor offers:
@@ -299,8 +300,6 @@
\preferences > \uicontrol Nim > \uicontrol Tools, \preferences > \uicontrol Nim > \uicontrol Tools,
and enter the path to the tool executable in the \uicontrol Path field. and enter the path to the tool executable in the \uicontrol Path field.
\sa {Document code} \sa {Document code}, {Use Qt Creator variables}
\else
\include qtcreator-variables.qdocinc qtcreator variables
\endif \endif
*/ */

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2021 The Qt Company Ltd. // Copyright (C) 2023 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
// ********************************************************************** // **********************************************************************
@@ -57,11 +57,11 @@
\li Select \preferences > \li Select \preferences >
\uicontrol Beautifier to specify settings for beautifying files. \uicontrol Beautifier to specify settings for beautifying files.
\li Select the \uicontrol {Enable auto format on file save} check box to \li Select the \uicontrol {Automatic formatting on file save} check box to
automatically beautify files when you save them using the tool you automatically beautify files when you save them using the tool you
select in the \uicontrol Tool field. select in the \uicontrol Tool field.
\image qt-creator-beautifier-options-general.png "General Beautifier preferences" \image qtcreator-preferences-beautifier-general.webp {General Beautifier preferences}
\li In the \uicontrol {Restrict to MIME types} field, define the MIME \li In the \uicontrol {Restrict to MIME types} field, define the MIME
types of the files to beautify, separated by semicolons. Leave the types of the files to beautify, separated by semicolons. Leave the

View File

@@ -81,7 +81,7 @@
\li In the \uicontrol Name field, enter a name for the language server. \li In the \uicontrol Name field, enter a name for the language server.
Select the \inlineimage icons/replace.png Select the \inlineimage icons/replace.png
(\uicontrol {Variables}) button to use a variable for the server (\uicontrol {Variables}) button to use a variable for the server
name. For more information, see \l{Using Qt Creator Variables}. name. For more information, see \l{Use Qt Creator variables}.
\li In the \uicontrol {Language} field, select \li In the \uicontrol {Language} field, select
\uicontrol {Set MIME Types} to select the MIME types of the files to \uicontrol {Set MIME Types} to select the MIME types of the files to
send to the language server. In the field below, you can enter file send to the language server. In the field below, you can enter file
@@ -113,7 +113,7 @@
\li In the \uicontrol Name field, enter a name for the language server. \li In the \uicontrol Name field, enter a name for the language server.
Select the \inlineimage icons/replace.png Select the \inlineimage icons/replace.png
(\uicontrol {Variables}) button to use a variable for the server (\uicontrol {Variables}) button to use a variable for the server
name. For more information, see \l{Using Qt Creator Variables}. name. For more information, see \l{Use Qt Creator variables}.
\li In the \uicontrol Java field, enter the path to the Java executable. \li In the \uicontrol Java field, enter the path to the Java executable.
\li In the \uicontrol {Java Language Server} field, enter the path to \li In the \uicontrol {Java Language Server} field, enter the path to
the Java language server \c .jar file. You can download the Java the Java language server \c .jar file. You can download the Java

View File

@@ -35,10 +35,12 @@
\image qtcreator-external-tools.png \image qtcreator-external-tools.png
\if defined(qtcreator)
Select the \inlineimage icons/replace.png Select the \inlineimage icons/replace.png
(\uicontrol {Variables}) button in a field to select from a list of (\uicontrol {Variables}) button in a field to select from a list of
\l{Using Qt Creator Variables}{variables} that are available in a \l{Use Qt Creator variables}{variables} that are available in a
particular context. particular context.
\endif
To configure external tools: To configure external tools:
@@ -71,8 +73,8 @@
\if defined(qtcreator) \if defined(qtcreator)
\li In the \uicontrol {Base environment} field, select whether to run \li In the \uicontrol {Base environment} field, select whether to run
the tool in the system environment or the \l{Build Environment} the tool in the system environment or the \l{Specify the environment for projects}
{build environment} or \l {Selecting the Run Environment} {build environment} or \l {Specify the run environment}
{run environment} of the active project. Select the build or run {run environment} of the active project. Select the build or run
environment if the system environment does not have the necessary environment if the system environment does not have the necessary
PATH settings to find the tool chain, for example. PATH settings to find the tool chain, for example.
@@ -82,20 +84,12 @@
\li In the \uicontrol Environment field, select \uicontrol Change to modify \li In the \uicontrol Environment field, select \uicontrol Change to modify
environment variable values for build and run environments in environment variable values for build and run environments in
the \uicontrol {Edit Environment Changes} dialog. the \uicontrol {Edit Environment} dialog.
\if defined(qtcreator)
For more information about how to add and remove variable values,
see \l{Batch Editing}.
\endif
To globally change the system environment from the one in which To globally change the system environment from the one in which
\QC is started, select \preferences > \QC is started, select \preferences >
\uicontrol Environment > \uicontrol System, and then select \uicontrol Environment > \uicontrol System, and then select
\uicontrol Change in the \uicontrol Environment field. \uicontrol Change in the \uicontrol Environment field.
\if defined(qtcreator)
For more information, see \l{Specifying Environment Settings}.
\endif
\li Select the \uicontrol {Modifies current document} check box to make sure \li Select the \uicontrol {Modifies current document} check box to make sure
that if the current document is modified by the tool, it is saved that if the current document is modified by the tool, it is saved
@@ -121,6 +115,11 @@
configuration file to the folder. configuration file to the folder.
\sa {Run QML files}, {Use external text editors}, {Use Qt Linguist} \sa {Run QML files}, {Use external text editors}, {Use Qt Linguist}
\if defined(qtcreator)
\sa {Batch edit environment settings}, {Specify the environment for projects},
{Use Qt Creator variables}
\endif
*/ */
/*! /*!

View File

@@ -412,7 +412,7 @@
\list 1 \list 1
\li Select \preferences > \uicontrol Environment > \uicontrol System. \li Select \preferences > \uicontrol Environment > \uicontrol System.
\image qtcreator-options-environment-system.png {System preferences} \image qtcreator-preferences-environment-system.webp {System preferences}
\li In \uicontrol {Maximum number of entries in "Recent Files"}, set \li In \uicontrol {Maximum number of entries in "Recent Files"}, set
the number of files to show. the number of files to show.
\endlist \endlist

View File

@@ -7,7 +7,7 @@
\ingroup creator-reference-build-systems \ingroup creator-reference-build-systems
\title Managing Packages with vcpkg \title vcpkg Package Manager
\brief The experimental vcpkg plugin integrates the vcpkg C/C++ package \brief The experimental vcpkg plugin integrates the vcpkg C/C++ package
manager into \QC. manager into \QC.
@@ -36,16 +36,31 @@
Select \inlineimage icons/online.png Select \inlineimage icons/online.png
to download vcpkg if you have not installed it yet. to download vcpkg if you have not installed it yet.
\section1 Creating vcpkg Manifest Files \sa {Create vcpkg manifest files}, {Edit vcpkg manifest files},
{Enable and disable plugins}
*/
/*!
\page creator-how-to-create-vcpkg-manifest-files.html
\previouspage creator-how-tos.html
\ingroup creator-how-to-projects
\title Create vcpkg manifest files
To create a new vcpkg package manager manifest (vcpkg.json) file: To create a new vcpkg package manager manifest (vcpkg.json) file:
\list 1 \list 1
\li Select \uicontrol File > \uicontrol {New File} > \li Select \uicontrol File > \uicontrol {New File} >
\uicontrol Vcpkg. \uicontrol vcpkg > \uicontrol {vcpkg.json Manifest File} >
\image qtcreator-file-new-file-vcpkg-manifest-file.webp {vcpkg.json Manifest File wizard page} \uicontrol Choose to open the \uicontrol Location dialog.
\li In \uicontrol {File name}, enter a name for the manifest file.
\li In \uicontrol Path, enter the path for the manifest file.
\li Select \uicontrol Next to open the
\uicontrol {vcpkg.json Manifest File} dialog.
\image qtcreator-file-new-file-vcpkg-manifest-file.webp {vcpkg.json Manifest File dialog}
\li In \uicontrol Name, enter a name for the manifest file. \li In \uicontrol Name, enter a name for the manifest file.
\li In \uicontrol Version, enter a version number for the file. \li In \uicontrol {Version string}, enter a version number for the file.
\li In \uicontrol Dependencies, enter the packages to manage. \li In \uicontrol Dependencies, enter the packages to manage.
You can add packages later in a manifest editor. You can add packages later in a manifest editor.
@@ -57,27 +72,51 @@
The wizard automatically adds the vcpkg.json file to the CMakeLists.txt file The wizard automatically adds the vcpkg.json file to the CMakeLists.txt file
of the project. of the project.
\section1 Selecting Packages to Manage \sa {vcpkg Package Manager}, {Edit vcpkg manifest files}
*/
/*!
\page creator-how-to-edit-vcpkg-manifest-files.html
\previouspage creator-how-tos.html
\ingroup creator-how-to-build
\title Edit vcpkg manifest files
When you open a vcpkg.json file, it opens in the manifest file editor: When you open a vcpkg.json file, it opens in the manifest file editor:
\image qtcreator-vcpkg-manifest-file-editor.webp {vcpkg.json file in the manifest file editor} \image qtcreator-vcpkg-manifest-file-editor.webp {vcpkg.json file in the manifest file editor}
\section1 Add packages to manage
To add a package to your project: To add a package to your project:
\list 1 \list 1
\li Place the cursor on the line where you want to add a package. \li Select the \inlineimage icons/vcpkg.png
\li Select the \inlineimage icons/zoom.png (\uicontrol {Add vcpkg Package}) button on the manifest editor
(\uicontrol {Search Package}) button. toolbar.
\image qtcreator-vcpkg-package-selector.webp {Package selector dialog} \image qtcreator-vcpkg-package-selector.webp {Add vcpkg Package dialog}
\li Select the package to add to your project. \li Select the package to add to your project.
\li Select \uicontrol OK to return to the editor. \li Select \uicontrol OK to return to the editor.
\li Repeat to add more packages. \li Repeat to add more packages.
\endlist \endlist
To set the path to the directory where you installed vcpkg, select \section1 Generate code for CMake configuration files
\inlineimage icons/settings.png
(\uicontrol Configure) on the editor toolbar.
\sa {Enable and disable plugins} To generate sample CMake code to copy to the CMakeLists.text file:
\list 1
\li Select the \inlineimage icons/cmake.png (\uicontrol {CMake Code})
button on the manifest editor toolbar.
\image qtcreator-vcpkg-cmake-config.webp {CMake Code dialog}
\li Select the example code you need and copy-paste it to the
CMakeLists.txt file.
\endlist
\section1 Set the path to vcpkg
To set the path to the directory where you installed vcpkg, select
\inlineimage icons/settings.png (\uicontrol Configure) on the editor toolbar.
\sa {vcpkg Package Manager}, {Create vcpkg manifest files}
*/ */

View File

@@ -11,6 +11,8 @@
You can connect iOS devices to your local machine with a USB cable to You can connect iOS devices to your local machine with a USB cable to
run applications built for them from \QC. run applications built for them from \QC.
\note Deployment, running, and debugging on iOS 17 devices are not supported.
To be able to use \QC on \macos, you must install Xcode, and therefore, To be able to use \QC on \macos, you must install Xcode, and therefore,
you already have the tool chain for building applications for iOS. \QC you already have the tool chain for building applications for iOS. \QC
automatically detects the tool chain and creates the necessary automatically detects the tool chain and creates the necessary

View File

@@ -48,6 +48,8 @@
\section1 iOS \section1 iOS
\note Deployment, running, and debugging on iOS 17 devices are not supported.
To be able to use \QC on \macos, you must install Xcode, and therefore To be able to use \QC on \macos, you must install Xcode, and therefore
you should already have the tool chain for building applications for you should already have the tool chain for building applications for
iOS. \QC automatically detects the tool chain and creates the necessary iOS. \QC automatically detects the tool chain and creates the necessary

View File

@@ -69,8 +69,7 @@
\li \image ok.png \li \image ok.png
\endtable \endtable
\note UWP support was removed from \QC 8.0. \note Deployment, running, and debugging on iOS 17 devices are not supported.
To develop for UWP using Qt 5, use \QC 7.0, or earlier.
\QC automatically runs scheduled checks for updates based on the settings \QC automatically runs scheduled checks for updates based on the settings
specified in \preferences > \uicontrol Environment > \uicontrol Update. specified in \preferences > \uicontrol Environment > \uicontrol Update.

View File

@@ -21,7 +21,7 @@
checkbox. checkbox.
Select the build directory in the \uicontrol {Build Directory} field. You Select the build directory in the \uicontrol {Build Directory} field. You
can use the \l{Using Qt Creator Variables}{variables} that are listed when can use the \l{Use Qt Creator variables}{variables} that are listed when
you select the \inlineimage icons/replace.png (\uicontrol {Variables}) you select the \inlineimage icons/replace.png (\uicontrol {Variables})
button. button.

View File

@@ -65,8 +65,7 @@
\li Class and script files for Python projects. \li Class and script files for Python projects.
\row \row
\li \uicontrol {vcpkg} (experimental) \li \uicontrol {vcpkg} (experimental)
\li \l {Managing Packages with vcpkg}{vcpkg package manager} manifest \li vcpkg package manager manifest files (vcpkg.json).
files (vcpkg.json).
\row \row
\li \uicontrol {Nim} (experimental) \li \uicontrol {Nim} (experimental)
\li Empty Nim source and script files. \li Empty Nim source and script files.
@@ -74,7 +73,7 @@
\sa {Create compiler explorer sessions}, {Create C++ classes}, \sa {Create compiler explorer sessions}, {Create C++ classes},
{Create OpenGL fragment and vertex shaders}, {Create resource files}, {Create OpenGL fragment and vertex shaders}, {Create resource files},
{Use project wizards} {Create vcpkg manifest files}, {Use project wizards}
*/ */
/*! /*!

View File

@@ -151,7 +151,7 @@
\li Select \uicontrol Change to modify environment variable values for \li Select \uicontrol Change to modify environment variable values for
build environments in the \uicontrol {Edit Environment Changes} build environments in the \uicontrol {Edit Environment Changes}
dialog. For more information about how to add and remove variable dialog. For more information about how to add and remove variable
values, see \l{Batch Editing}. values, see \l{Batch edit environment settings}.
\row \row
\li \uicontrol {Force UTF-8 MSVC compiler output} \li \uicontrol {Force UTF-8 MSVC compiler output}
\li Either switches the language of MSVC to English or keeps the \li Either switches the language of MSVC to English or keeps the

View File

@@ -110,10 +110,8 @@
tested or grouping commands, are not supported because the value of the tested or grouping commands, are not supported because the value of the
\uicontrol Executable field is always placed first when constructing the command. \uicontrol Executable field is always placed first when constructing the command.
You can use \l {Using Environment Variables}{environment variables} as You can \l {Use Qt Creator variables}{use \QC variables} in arguments,
values in the fields. In addition, you can \l {Using Qt Creator Variables} executable paths, and working directories.
{use \QC variables} in arguments, executable paths, and working
directories.
\section1 Build Steps \section1 Build Steps

View File

@@ -1,16 +1,17 @@
// Copyright (C) 2021 The Qt Company Ltd. // Copyright (C) 2023 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-build-dependencies.html \page creator-how-set-project-environment.html
\page creator-project-settings-environment.html \previouspage creator-how-tos.html
\nextpage creator-custom-output-parsers.html
\title Specifying Environment Settings \ingroup creator-how-to-projects
You can specify the environment you want to use for building \title Specify the environment for projects
a project in the \uicontrol {Build Environment} section of
the \uicontrol {Build Settings}. The environment for a project is determined according to a settings hierarchy:
\image qtcreator-environment-settings-hierarchy.webp {Environment settings hierarchy}
By default, the environment in which \QC was started is used and modified By default, the environment in which \QC was started is used and modified
to include the Qt version. Depending on the selected Qt version, \QC to include the Qt version. Depending on the selected Qt version, \QC
@@ -18,36 +19,109 @@
existing environment variables or add, reset and unset new variables existing environment variables or add, reset and unset new variables
based on your project requirements. based on your project requirements.
To globally change the system environment from the one in which The final environment is specified separately for each kit. With
\QC is started, select \preferences > project-specific environment settings you can change the environment for
\uicontrol Environment > \uicontrol System, and then select all kits that you use to build, deploy, and run the project simultaneously,
\uicontrol Change in the \uicontrol Environment field. rather than having to change it separately for each kit.
\image qtcreator-options-environment-system.png "Environment preferences System tab" The changes are stored in the local project-specific \c{CMakeLists.txt.user}
or \c{.pro.user} file, depending on the build system you use, such as CMake
or qmake. Therefore, they are not suitable for sharing between developers or
development PCs. To share settings, incorporate them into the build system.
For example, if you use CMake, make the changes in the \c {CMakeLists.txt}
file, and if you use qmake, make the changes in the \c{.pro} file.
In addition, you can specify custom environment variables in the \section1 Globally change the environment
\uicontrol {Project Settings} > \uicontrol Environment settings.
They are added to all build environments. The final build environment
is specified separately for each kit. The project-specific environment
settings enable you to amend the build environment for all kits that
you use to build the project simultaneously, rather than having to edit
it separately for each kit.
\image qtcreator-build-environment.png "Build Environment" To globally change the environment from the one in which \QC is started,
select \preferences > \uicontrol Environment > \uicontrol System, and then
select \uicontrol Change in the \uicontrol Environment field.
The changes are stored in the local project specific \c{CMakeLists.txt.user} \image qtcreator-preferences-environment-system.webp "Environment preferences System tab"
or \c{.pro.user} file, depending on the build system you use. Therefore,
they are not suitable for sharing between developers or development PCs. To
share settings, incorporate them into the build system. For example, if you
use CMake, make the changes in the \c {CMakeLists.txt} file, and if you use
qmake, make the changes in the \c{.pro} file.
\section1 Batch Editing \section1 Change the environment for a project
To modify environment variable values for build or run environments, To change the system environment for a project from the one in which
select \uicontrol {Batch Edit} in the \uicontrol {Build Environment} \QC is started, select \uicontrol Projects > \uicontrol {Project Settings}
or \uicontrol {Environment} pane and enter environment variables in > \uicontrol Environment.
the \uicontrol {Edit Environment} dialog.
\image qtcreator-projects-environment.webp {Environment tab in Project Settings}
\section1 Specify the build environment
Specify the build environment to use for a kit in \uicontrol Projects >
\uicontrol {Build Settings} > \uicontrol {Build Environment}.
\image qtcreator-build-environment.png {Build Environment section in Build Settings}
\section2 Clear the build environment
To build with a clean system environment, select the \uicontrol {Clear
system environment} check box. \QC discards the current environment, and
populates a clean system environment with the environment variables that
the compilers and tools need. Therefore, the environment is never totally
empty, even after you clear it.
\section1 Specify the run environment
\QC automatically selects the environment used for running the application
based on the \l{glossary-device}{device} type. You can edit the environment
or select another environment in \uicontrol Projects >
\uicontrol {Run Settings} > \uicontrol {Environment}.
You can edit existing environment variables or add, reset and unset new
variables.
\image qtcreator-run-environment.png {Environment section in Run Settings}
When running on the desktop, the \uicontrol {Build Environment} is used by
default, but you can also use the \uicontrol {System Environment} without the
additions made to the build environment.
To modify the environment variable values for the run environment,
double-click environment variables or their values and change them inline,
or select \uicontrol {Batch Edit} to change several variable values at a
time.
\section2 Clean the run environment
To run in a clean system environment, select \uicontrol {Clean Environment}.
\section2 Run on devices
When running on a mobile device connected to the development host, \QC
fetches information about the \uicontrol {Device Environment} from the device.
Usually, it does not make sense to edit the device environment.
\sa {Batch edit environment settings}, {Specifying Build Settings},
{Specifying Run Settings}, {Use Qt Creator variables}
*/
/*!
\page creator-how-to-batch-edit-environment-settings.html
\previouspage creator-how-tos.html
\ingroup creator-how-to-projects
\title Batch edit environment settings
You can change the environment variable values for build or run environments
either for a particular project or globally for all projects in the
\uicontrol {Edit Environment} dialog:
\list
\li To change values globally, select \uicontrol Change in the
\l {Globally change the environment}{global environment preferences}.
\li To change values for a project, select \uicontrol {Batch Edit} in the
\l {Change the environment for a project}{project},
\l {Specify the build environment}{build}, or
\l {Specify the run environment}{run} environment settings.
\endlist
\image qtcreator-edit-environment.webp {Edit Environment dialog}
Use the following syntax to enter environment variable names and values:
\c {<VARIABLE>=<VALUE>}.
To remove a variable value from the environment, enter the variable name. To remove a variable value from the environment, enter the variable name.
For example, \c TEST sets the value of the \c TEST variable empty when For example, \c TEST sets the value of the \c TEST variable empty when
@@ -70,21 +144,6 @@
To temporarily disable a variable, add a hash character (#) to the beginning To temporarily disable a variable, add a hash character (#) to the beginning
of the line. of the line.
\section1 Clearing the System Environment \sa {Specify the environment for projects}, {Specifying Build Settings},
{Use Qt Creator variables}
To build with a clean system environment, select the \uicontrol {Clear
system environment} check box. \QC discards the current environment, and
populates a clean system environment with the environment variables that
the compilers and tools need. Therefore, the environment is never totally
empty, even after you clear it.
\section1 Using Environment Variables
You can use any environment variables in build, deploy, and run
configurations. For a list of variable names, select \uicontrol {Build
Settings} > \uicontrol {Build Environment} > \uicontrol Details.
Environment variables are referenced using the native syntax: $VARNAME
or ${VARNAME} on Unix and %VARNAME% on Windows.
\include qtcreator-variables.qdocinc qtcreator variables
*/ */

View File

@@ -14,13 +14,12 @@
\title Configuring Projects \title Configuring Projects
When you install Qt for a target platform, such as Android or QNX, When you install Qt for a development or target platform, such as Linux,
\l{https://www.qt.io/download-qt-installer}{\QOI} \macos, Windows, Android or QNX, \l{https://www.qt.io/download-qt-installer}
creates \l{glossary-buildandrun-kit}{kits} for the development {\QOI} creates \l{glossary-buildandrun-kit}{kits} for the development targets.
targets.
Select the kits to use in the \uicontrol {Configure Projects} Select the kits to use for a project in the \uicontrol {Configure Projects}
view when you open a project for the first time. At least one kit must be view when you open the project for the first time. At least one kit must be
active. active.
To maintain the list of active kits for a currently open project, switch to To maintain the list of active kits for a currently open project, switch to
@@ -29,7 +28,7 @@
\image qtcreator-projects-kits.webp {Sidebar in the Projects mode} \image qtcreator-projects-kits.webp {Sidebar in the Projects mode}
To specify build or run settings for a kit, select \uicontrol Build or To specify build or run settings for a kit, select \uicontrol Build or
\uicontrol Run below the kit. \uicontrol Run below the kit name.
\section1 Overriding Global Preferences \section1 Overriding Global Preferences
@@ -45,7 +44,7 @@
\li \l{Specify dependencies}{Dependencies} \li \l{Specify dependencies}{Dependencies}
\li \l{Document code}{Documentation Comments} \li \l{Document code}{Documentation Comments}
\li \l{Specify editor settings}{Editor} \li \l{Specify editor settings}{Editor}
\li \l{Specifying Environment Settings}{Environment} \li \l{Specify the environment for projects}{Environment}
\li \l{Applying Refactoring Actions}{Quick Fixes} \li \l{Applying Refactoring Actions}{Quick Fixes}
\li \l{To-Do Entries}{To-Do} (experimental) \li \l{To-Do Entries}{To-Do} (experimental)
\endlist \endlist
@@ -69,7 +68,7 @@
lists the kits that are compatible with your project. To activate one or more lists the kits that are compatible with your project. To activate one or more
kits, click them. kits, click them.
\image qtcreator-project-kits.png \image qtcreator-project-kits.png {List of kits in Projects mode sidebar}
The list displays kits from \preferences > The list displays kits from \preferences >
\uicontrol Kits. Warning and error icons indicate that the kit configuration \uicontrol Kits. Warning and error icons indicate that the kit configuration

View File

@@ -27,7 +27,7 @@
To run with special environment variables set up, select them in the To run with special environment variables set up, select them in the
\uicontrol {Run Environment} section. For more information, see \uicontrol {Run Environment} section. For more information, see
\l {Selecting the Run Environment}. \l {Specify the run environment}.
When building an application, \QC creates a list of directories where the When building an application, \QC creates a list of directories where the
linker will look for libraries that the application links to. By linker will look for libraries that the application links to. By

View File

@@ -95,31 +95,6 @@
\include creator-projects-settings-run-qnx.qdocinc run settings qnx \include creator-projects-settings-run-qnx.qdocinc run settings qnx
\include linux-mobile/creator-projects-settings-run-b2qt.qdocinc run settings boot2qt \include linux-mobile/creator-projects-settings-run-b2qt.qdocinc run settings boot2qt
\section1 Selecting the Run Environment
\QC automatically selects the environment used for running the application
based on the \l{glossary-device}{device} type. You can edit the environment
or select another environment in the \uicontrol {Run Environment} section.
You can edit existing environment variables or add, reset and unset new
variables.
\image qtcreator-run-environment.png {Run Environment section}
When running on the desktop, the \uicontrol {Build Environment} is used by
default, but you can also use the \uicontrol {System Environment} without the
additions made to the build environment. For more information, see
\l {Build Environment} and \l{Specifying Environment Settings}.
To run in a clean system environment, select \uicontrol {Clean Environment}.
When running on a mobile device connected to the development host, \QC
fetches information about the \uicontrol {Device Environment} from the device.
Usually, it does not make sense to edit the device environment.
To modify the environment variable values for the run environment, select
\uicontrol {Batch Edit}. For more information, see \l{Batch Editing}.
\section1 Specifying a Custom Executable to Run \section1 Specifying a Custom Executable to Run
If you use CMake, Meson or the generic project type in \QC, or want If you use CMake, Meson or the generic project type in \QC, or want

View File

@@ -1,13 +1,19 @@
// Copyright (C) 2021 The Qt Company Ltd. // Copyright (C) 2023 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
/*! /*!
//! [qtcreator variables] \page creator-how-to-use-qtc-variables.html
\section1 Using Qt Creator Variables \previouspage creator-how-tos.html
You can use \QC variables in arguments, executable paths, and working \ingroup creator-how-to-projects
directories. The variables take care of quoting their expansions, so you do
not need to put them in quotes. \title Use Qt Creator variables
You can use \QC variables in \uicontrol Preferences,
\uicontrol {Build Settings}, and \uicontrol {Run Settings}, in fields that
set arguments, executable paths, and working directories, for example. The
variables take care of quoting their expansions, so you do not need to put
them in quotes.
Select the \inlineimage icons/replace.png Select the \inlineimage icons/replace.png
(\uicontrol {Variables}) button in a field to select from a list of (\uicontrol {Variables}) button in a field to select from a list of
@@ -15,7 +21,7 @@
For more information about each variable, move the cursor over it in the For more information about each variable, move the cursor over it in the
list. list.
\image qtcreator-variables.png "Qt Creator Variables dialog displaying a tooltip" \image qtcreator-variables.png {Qt Creator Variables dialog showing a tooltip}
The following syntax enables you to use environment variables as \QC The following syntax enables you to use environment variables as \QC
variables: %{Env:VARNAME}. variables: %{Env:VARNAME}.
@@ -38,7 +44,7 @@
backreferences. For example, if \c %{variable} is \c my123var, then backreferences. For example, if \c %{variable} is \c my123var, then
\c %{variable/(..)(\d+)/\2\1} is expanded to \c {123myvar}. \c %{variable/(..)(\d+)/\2\1} is expanded to \c {123myvar}.
Instead of the forward slash, you can also use the pound sign (\c #) as Instead of the forward slash, you can also use the number sign (\c #) as
the substitution character. This can be helpful if the value is supposed the substitution character. This can be helpful if the value is supposed
to be a file path, in which case forward slashes might get translated to be a file path, in which case forward slashes might get translated
to backslashes on Windows hosts. to backslashes on Windows hosts.
@@ -48,5 +54,6 @@
\badcode \badcode
%{variable:-default} %{variable:-default}
\endcode \endcode
//! [qtcreator variables]
\sa {Specify the environment for projects}, {Specifying Build Settings},
*/ */

View File

@@ -39,7 +39,6 @@
\li \l{Conan Build Configuration} \li \l{Conan Build Configuration}
\endlist \endlist
\li \l{Specifying Run Settings} \li \l{Specifying Run Settings}
\li \l{Specifying Environment Settings}
\li \l{Using Custom Output Parsers} \li \l{Using Custom Output Parsers}
\li \l{Sharing Project Settings} \li \l{Sharing Project Settings}
\endlist \endlist

View File

@@ -38,7 +38,7 @@
To set preferences for opening files and handling open files, select To set preferences for opening files and handling open files, select
\preferences > \uicontrol Environment > \uicontrol System: \preferences > \uicontrol Environment > \uicontrol System:
\image qtcreator-options-environment-system.png {System tab in Environment preferences} \image qtcreator-preferences-environment-system.webp {System tab in Environment preferences}
\list \list
\li In the \uicontrol {When files are externally modified} field, \li In the \uicontrol {When files are externally modified} field,

View File

@@ -1282,6 +1282,10 @@ protected:
out(ast->rparenToken); out(ast->rparenToken);
if (ast->isArrowFunction && !ast->formals) if (ast->isArrowFunction && !ast->formals)
out("()"); out("()");
if (ast->typeAnnotation) {
out(": ");
out(ast->typeAnnotation->type->toString());
}
out(" "); out(" ");
if (ast->isArrowFunction) if (ast->isArrowFunction)
out("=> "); out("=> ");
@@ -1406,6 +1410,10 @@ protected:
{ {
for (FormalParameterList *it = ast; it; it = it->next) { for (FormalParameterList *it = ast; it; it = it->next) {
accept(it->element); accept(it->element);
if (it->element->typeAnnotation) {
out(": ");
out(it->element->typeAnnotation->type->toString());
}
if (it->next) if (it->next)
out(", "); out(", ");
} }

View File

@@ -2728,10 +2728,7 @@ TimeoutTaskAdapter::~TimeoutTaskAdapter()
void TimeoutTaskAdapter::start() void TimeoutTaskAdapter::start()
{ {
if (*task() == milliseconds::zero()) m_timerId = scheduleTimeout(*task(), this, [this] { m_timerId = {}; emit done(true); });
QTimer::singleShot(0, this, [this] { emit done(true); });
else
m_timerId = scheduleTimeout(*task(), this, [this] { m_timerId = {}; emit done(true); });
} }
} // namespace Tasking } // namespace Tasking

View File

@@ -83,6 +83,7 @@ public:
bool m_enabled = true; bool m_enabled = true;
bool m_readOnly = false; bool m_readOnly = false;
bool m_autoApply = true; bool m_autoApply = true;
bool m_hasEnabler = false;
int m_spanX = 1; int m_spanX = 1;
int m_spanY = 1; int m_spanY = 1;
BaseAspect::ConfigWidgetCreator m_configWidgetCreator; BaseAspect::ConfigWidgetCreator m_configWidgetCreator;
@@ -347,6 +348,8 @@ void BaseAspect::setEnabler(BoolAspect *checker)
{ {
QTC_ASSERT(checker, return); QTC_ASSERT(checker, return);
d->m_hasEnabler = true;
auto update = [this, checker] { auto update = [this, checker] {
BaseAspect::setEnabled(checker->isEnabled() && checker->volatileValue()); BaseAspect::setEnabled(checker->isEnabled() && checker->volatileValue());
}; };
@@ -646,6 +649,10 @@ void BaseAspect::readSettings()
if (settingsKey().isEmpty()) if (settingsKey().isEmpty())
return; return;
QTC_ASSERT(theSettings, return); QTC_ASSERT(theSettings, return);
// The enabler needs to be set up after reading the settings, otherwise
// changes from reading the settings will not update the enabled state
// because the updates are "quiet".
QTC_CHECK(!d->m_hasEnabler);
const QVariant val = theSettings->value(settingsKey()); const QVariant val = theSettings->value(settingsKey());
setVariantValue(val.isValid() ? fromSettingsValue(val) : defaultVariantValue(), BeQuiet); setVariantValue(val.isValid() ? fromSettingsValue(val) : defaultVariantValue(), BeQuiet);
} }
@@ -1794,8 +1801,6 @@ LayoutItem BoolAspect::adoptButton(QAbstractButton *button)
*/ */
void BoolAspect::addToLayout(Layouting::LayoutItem &parent) void BoolAspect::addToLayout(Layouting::LayoutItem &parent)
{ {
QTC_ASSERT(m_buffer == m_internal, m_buffer = m_internal);
QCheckBox *checkBox = createSubWidget<QCheckBox>(); QCheckBox *checkBox = createSubWidget<QCheckBox>();
addToLayoutHelper(parent, checkBox); addToLayoutHelper(parent, checkBox);
bufferToGui(); bufferToGui();
@@ -1903,7 +1908,6 @@ void SelectionAspect::addToLayout(Layouting::LayoutItem &parent)
QTC_CHECK(d->m_buttonGroup == nullptr); QTC_CHECK(d->m_buttonGroup == nullptr);
QTC_CHECK(!d->m_comboBox); QTC_CHECK(!d->m_comboBox);
QTC_ASSERT(d->m_buttons.isEmpty(), d->m_buttons.clear()); QTC_ASSERT(d->m_buttons.isEmpty(), d->m_buttons.clear());
QTC_ASSERT(m_buffer == m_internal, m_buffer = m_internal);
switch (d->m_displayStyle) { switch (d->m_displayStyle) {
case DisplayStyle::RadioButtons: case DisplayStyle::RadioButtons:

View File

@@ -1256,7 +1256,8 @@ bool UnixDeviceFileAccess::iterateWithFind(const FilePath &filePath,
void UnixDeviceFileAccess::findUsingLs(const QString &current, void UnixDeviceFileAccess::findUsingLs(const QString &current,
const FileFilter &filter, const FileFilter &filter,
QStringList *found) const QStringList *found,
const QString &start) const
{ {
const RunResult result = runInShell( const RunResult result = runInShell(
{"ls", {"-1", "-a", "-p", "--", current}, OsType::OsTypeLinux}); {"ls", {"-1", "-a", "-p", "--", current}, OsType::OsTypeLinux});
@@ -1265,10 +1266,11 @@ void UnixDeviceFileAccess::findUsingLs(const QString &current,
const QChar last = entry.back(); const QChar last = entry.back();
if (last == '/') { if (last == '/') {
entry.chop(1); entry.chop(1);
if (filter.iteratorFlags.testFlag(QDirIterator::Subdirectories)) if (filter.iteratorFlags.testFlag(QDirIterator::Subdirectories) && entry != "."
findUsingLs(current + '/' + entry, filter, found); && entry != "..")
findUsingLs(current + '/' + entry, filter, found, start + entry + "/");
} }
found->append(entry); found->append(start + entry);
} }
} }
@@ -1327,7 +1329,7 @@ void UnixDeviceFileAccess::iterateDirectory(const FilePath &filePath,
// if we do not have find - use ls as fallback // if we do not have find - use ls as fallback
QStringList entries; QStringList entries;
findUsingLs(filePath.path(), filter, &entries); findUsingLs(filePath.path(), filter, &entries, {});
iterateLsOutput(filePath, entries, filter, callBack); iterateLsOutput(filePath, entries, filter, callBack);
} }

View File

@@ -183,16 +183,15 @@ protected:
expected_str<FilePath> createTempFile(const FilePath &filePath) override; expected_str<FilePath> createTempFile(const FilePath &filePath) override;
void findUsingLs(const QString &current,
const FileFilter &filter,
QStringList *found,
const QString &start) const;
private: private:
bool iterateWithFind( bool iterateWithFind(const FilePath &filePath,
const FilePath &filePath, const FileFilter &filter,
const FileFilter &filter, const FilePath::IterateDirCallback &callBack) const;
const FilePath::IterateDirCallback &callBack) const;
void findUsingLs(
const QString &current,
const FileFilter &filter,
QStringList *found) const;
QStringList statArgs(const FilePath &filePath, QStringList statArgs(const FilePath &filePath,
const QString &linuxFormat, const QString &linuxFormat,

View File

@@ -8,7 +8,11 @@
#include "terminalcommand.h" #include "terminalcommand.h"
#include "utilstr.h" #include "utilstr.h"
#include <QLoggingCategory>
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QVersionNumber>
Q_LOGGING_CATEGORY(log, "terminal.externalprocess", QtWarningMsg)
namespace Utils { namespace Utils {
@@ -17,22 +21,62 @@ ExternalTerminalProcessImpl::ExternalTerminalProcessImpl()
setStubCreator(new ProcessStubCreator(this)); setStubCreator(new ProcessStubCreator(this));
} }
QString ExternalTerminalProcessImpl::openTerminalScriptAttached()
{
static const QLatin1String script{R"(
tell application "Terminal"
activate
set windowId to 0
set newTab to do script "%1 && exit"
-- Try to get window id
try
-- We have seen this work on macOS 13, and 12.5.1, but not on 14.0 or 14.1
set windowId to (the id of window 1 where its tab 1 = newTab) as text
on error eMsg number eNum
-- If we get an error we try to generate a known error that will contain the window id in its message
try
set windowId to window of newTab
on error eMsg number eNum
if eNum = -1728 then
try
-- Search for "window id " in the error message, examples of error messages are:
-- Terminal hat einen Fehler erhalten: window of tab 1 of window id 4018 kann nicht gelesen werden.
-- Terminal got an error: Can't get window of tab 1 of window id 4707.
set windowIdPrefix to "window id "
set theOffset to (offset of windowIdPrefix in eMsg)
if theOffset = 0 then
log "Failed to parse window id from error message: " & eMsg
else
set windowIdPosition to theOffset + (length of windowIdPrefix)
set windowId to (first word of (text windowIdPosition thru -1 of eMsg)) as integer
end if
on error eMsg2 number eNum2
log "Failed to parse window id from error message: " & eMsg2 & " (" & eMsg & ") " & theOffset
end try
end if
end try
end try
repeat until ((count of processes of newTab) = 0)
delay 0.1
end repeat
if windowId is not equal to 0 then
close window id windowId
else
log "Cannot close window, sorry."
end if
end tell
)"};
return script;
}
ProcessStubCreator::ProcessStubCreator(TerminalInterface *interface) ProcessStubCreator::ProcessStubCreator(TerminalInterface *interface)
: m_interface(interface) : m_interface(interface)
{} {}
static const QLatin1String TerminalAppScriptAttached{R"(
tell application "Terminal"
activate
set newTab to do script "%1 && exit"
set win to (the id of window 1 where its tab 1 = newTab) as text
repeat until ((count of processes of newTab) = 0)
delay 0.1
end repeat
close window id win
end tell
)"};
static const QLatin1String TerminalAppScriptDetached{R"( static const QLatin1String TerminalAppScriptDetached{R"(
tell application "Terminal" tell application "Terminal"
activate activate
@@ -52,8 +96,15 @@ expected_str<qint64> ProcessStubCreator::startStubProcess(const ProcessSetupData
bool detached = setupData.m_terminalMode == TerminalMode::Detached; bool detached = setupData.m_terminalMode == TerminalMode::Detached;
if (HostOsInfo::isMacHost()) { if (HostOsInfo::isMacHost()) {
// There is a bug in macOS 14.0 where the script fails if it tries to find
// the window id. We will have to check in future versions of macOS if they fixed
// the issue.
static const QVersionNumber osVersionNumber = QVersionNumber::fromString(
QSysInfo::productVersion());
static const QMap<QString, AppScript> terminalMap = { static const QMap<QString, AppScript> terminalMap = {
{"Terminal.app", {TerminalAppScriptAttached, TerminalAppScriptDetached}}, {"Terminal.app",
{ExternalTerminalProcessImpl::openTerminalScriptAttached(), TerminalAppScriptDetached}},
}; };
if (terminalMap.contains(terminal.command.toString())) { if (terminalMap.contains(terminal.command.toString())) {
@@ -101,6 +152,17 @@ expected_str<qint64> ProcessStubCreator::startStubProcess(const ProcessSetupData
Tr::tr("Failed to start terminal process: \"%1\".").arg(process->errorString())); Tr::tr("Failed to start terminal process: \"%1\".").arg(process->errorString()));
} }
QObject::connect(process, &Process::readyReadStandardOutput, process, [process] {
const QString output = process->readAllStandardOutput();
if (!output.isEmpty())
qCWarning(log).noquote() << output;
});
QObject::connect(process, &Process::readyReadStandardError, process, [process] {
const QString output = process->readAllStandardError();
if (!output.isEmpty())
qCCritical(log).noquote() << output;
});
QObject::connect(process, &Process::done, m_interface, &TerminalInterface::onStubExited); QObject::connect(process, &Process::done, m_interface, &TerminalInterface::onStubExited);
return 0; return 0;

View File

@@ -13,6 +13,8 @@ class QTCREATOR_UTILS_EXPORT ExternalTerminalProcessImpl final : public Terminal
{ {
public: public:
ExternalTerminalProcessImpl(); ExternalTerminalProcessImpl();
static QString openTerminalScriptAttached();
}; };
class QTCREATOR_UTILS_EXPORT ProcessStubCreator : public StubCreator class QTCREATOR_UTILS_EXPORT ProcessStubCreator : public StubCreator

View File

@@ -92,6 +92,7 @@ public:
StubCreator *stubCreator{nullptr}; StubCreator *stubCreator{nullptr};
const bool waitOnExit; const bool waitOnExit;
bool didInferiorRun{false};
}; };
TerminalInterface::TerminalInterface(bool waitOnExit) TerminalInterface::TerminalInterface(bool waitOnExit)
@@ -156,6 +157,11 @@ void TerminalInterface::onStubExited()
if (d->inferiorProcessId) if (d->inferiorProcessId)
emitFinished(-1, QProcess::CrashExit); emitFinished(-1, QProcess::CrashExit);
else if (!d->didInferiorRun) {
emitError(QProcess::FailedToStart,
Tr::tr("Failed to start terminal process. The stub exited before the inferior "
"was started."));
}
} }
void TerminalInterface::onStubReadyRead() void TerminalInterface::onStubReadyRead()
@@ -176,6 +182,7 @@ void TerminalInterface::onStubReadyRead()
d->envListFile = nullptr; d->envListFile = nullptr;
} else if (out.startsWith("pid ")) { } else if (out.startsWith("pid ")) {
d->inferiorProcessId = out.mid(4).toInt(); d->inferiorProcessId = out.mid(4).toInt();
d->didInferiorRun = true;
emit started(d->inferiorProcessId, d->inferiorThreadId); emit started(d->inferiorProcessId, d->inferiorThreadId);
} else if (out.startsWith("thread ")) { // Windows only } else if (out.startsWith("thread ")) { // Windows only
d->inferiorThreadId = out.mid(7).toLongLong(); d->inferiorThreadId = out.mid(7).toLongLong();
@@ -349,8 +356,9 @@ void TerminalInterface::start()
return; return;
} }
QTextStream stream(d->envListFile.get()); QTextStream stream(d->envListFile.get());
finalEnv.forEachEntry([&stream](const QString &key, const QString &value, bool) { finalEnv.forEachEntry([&stream](const QString &key, const QString &value, bool enabled) {
stream << key << '=' << value << '\0'; if (enabled)
stream << key << '=' << value << '\0';
}); });
if (d->envListFile->error() != QFile::NoError) { if (d->envListFile->error() != QFile::NoError) {

View File

@@ -136,7 +136,6 @@ AutotestPluginPrivate::AutotestPluginPrivate()
TestFrameworkManager::registerTestFramework(&theCatchFramework()); TestFrameworkManager::registerTestFramework(&theCatchFramework());
TestFrameworkManager::registerTestTool(&theCTestTool()); TestFrameworkManager::registerTestTool(&theCTestTool());
TestFrameworkManager::synchronizeSettings();
m_resultsPane = TestResultsPane::instance(); m_resultsPane = TestResultsPane::instance();

View File

@@ -74,7 +74,6 @@ BoostTestFramework::BoostTestFramework()
seed.setLabelText(Tr::tr("Seed:")); seed.setLabelText(Tr::tr("Seed:"));
seed.setToolTip(Tr::tr("A seed of 0 means no randomization. A value of 1 uses the current " seed.setToolTip(Tr::tr("A seed of 0 means no randomization. A value of 1 uses the current "
"time, any other value is used as random seed generator.")); "time, any other value is used as random seed generator."));
seed.setEnabler(&randomize);
randomize.setSettingsKey("Randomize"); randomize.setSettingsKey("Randomize");
randomize.setLabelPlacement(BoolAspect::LabelPlacement::Compact); randomize.setLabelPlacement(BoolAspect::LabelPlacement::Compact);
@@ -96,6 +95,10 @@ BoostTestFramework::BoostTestFramework()
memLeaks.setDefaultValue(true); memLeaks.setDefaultValue(true);
memLeaks.setLabelText(Tr::tr("Detect memory leaks")); memLeaks.setLabelText(Tr::tr("Detect memory leaks"));
memLeaks.setToolTip(Tr::tr("Enable memory leak detection.")); memLeaks.setToolTip(Tr::tr("Enable memory leak detection."));
readSettings();
seed.setEnabler(&randomize);
} }
QString BoostTestFramework::logLevelToOption(const LogLevel logLevel) QString BoostTestFramework::logLevelToOption(const LogLevel logLevel)

View File

@@ -49,29 +49,24 @@ CatchFramework::CatchFramework()
abortAfter.setSettingsKey("AbortAfter"); abortAfter.setSettingsKey("AbortAfter");
abortAfter.setRange(1, 9999); abortAfter.setRange(1, 9999);
abortAfter.setEnabler(&abortAfterChecked);
benchmarkSamples.setSettingsKey("BenchSamples"); benchmarkSamples.setSettingsKey("BenchSamples");
benchmarkSamples.setRange(1, 999999); benchmarkSamples.setRange(1, 999999);
benchmarkSamples.setDefaultValue(100); benchmarkSamples.setDefaultValue(100);
benchmarkSamples.setEnabler(&samplesChecked);
benchmarkResamples.setSettingsKey("BenchResamples"); benchmarkResamples.setSettingsKey("BenchResamples");
benchmarkResamples.setRange(1, 9999999); benchmarkResamples.setRange(1, 9999999);
benchmarkResamples.setDefaultValue(100000); benchmarkResamples.setDefaultValue(100000);
benchmarkResamples.setToolTip(Tr::tr("Number of resamples for bootstrapping.")); benchmarkResamples.setToolTip(Tr::tr("Number of resamples for bootstrapping."));
benchmarkResamples.setEnabler(&resamplesChecked);
confidenceInterval.setSettingsKey("BenchConfInt"); confidenceInterval.setSettingsKey("BenchConfInt");
confidenceInterval.setRange(0., 1.); confidenceInterval.setRange(0., 1.);
confidenceInterval.setSingleStep(0.05); confidenceInterval.setSingleStep(0.05);
confidenceInterval.setDefaultValue(0.95); confidenceInterval.setDefaultValue(0.95);
confidenceInterval.setEnabler(&confidenceIntervalChecked);
benchmarkWarmupTime.setSettingsKey("BenchWarmup"); benchmarkWarmupTime.setSettingsKey("BenchWarmup");
benchmarkWarmupTime.setSuffix(Tr::tr(" ms")); benchmarkWarmupTime.setSuffix(Tr::tr(" ms"));
benchmarkWarmupTime.setRange(0, 10000); benchmarkWarmupTime.setRange(0, 10000);
benchmarkWarmupTime.setEnabler(&warmupChecked);
abortAfterChecked.setSettingsKey("AbortChecked"); abortAfterChecked.setSettingsKey("AbortChecked");
abortAfterChecked.setLabelText(Tr::tr("Abort after")); abortAfterChecked.setLabelText(Tr::tr("Abort after"));
@@ -117,6 +112,14 @@ CatchFramework::CatchFramework()
warnOnEmpty.setSettingsKey("WarnEmpty"); warnOnEmpty.setSettingsKey("WarnEmpty");
warnOnEmpty.setLabelText(Tr::tr("Warn on empty tests")); warnOnEmpty.setLabelText(Tr::tr("Warn on empty tests"));
warnOnEmpty.setToolTip(Tr::tr("Warns if a test section does not check any assertion.")); warnOnEmpty.setToolTip(Tr::tr("Warns if a test section does not check any assertion."));
readSettings();
benchmarkWarmupTime.setEnabler(&warmupChecked);
confidenceInterval.setEnabler(&confidenceIntervalChecked);
benchmarkResamples.setEnabler(&resamplesChecked);
benchmarkSamples.setEnabler(&samplesChecked);
abortAfter.setEnabler(&abortAfterChecked);
} }
ITestParser *CatchFramework::createTestParser() ITestParser *CatchFramework::createTestParser()

View File

@@ -108,6 +108,9 @@ CTestTool::CTestTool()
threshold.setLabelText(Tr::tr("Threshold")); threshold.setLabelText(Tr::tr("Threshold"));
threshold.setDefaultValue(1); threshold.setDefaultValue(1);
threshold.setRange(1, 128); threshold.setRange(1, 128);
readSettings();
threshold.setEnabler(&testLoad); threshold.setEnabler(&testLoad);
} }

View File

@@ -52,7 +52,6 @@ GTestFramework::GTestFramework()
iterations.setDefaultValue(1); iterations.setDefaultValue(1);
iterations.setEnabled(false); iterations.setEnabled(false);
iterations.setLabelText(Tr::tr("Iterations:")); iterations.setLabelText(Tr::tr("Iterations:"));
iterations.setEnabler(&repeat);
seed.setSettingsKey("Seed"); seed.setSettingsKey("Seed");
seed.setSpecialValueText({}); seed.setSpecialValueText({});
@@ -60,7 +59,6 @@ GTestFramework::GTestFramework()
seed.setEnabled(false); seed.setEnabled(false);
seed.setLabelText(Tr::tr("Seed:")); seed.setLabelText(Tr::tr("Seed:"));
seed.setToolTip(Tr::tr("A seed of 0 generates a seed based on the current timestamp.")); seed.setToolTip(Tr::tr("A seed of 0 generates a seed based on the current timestamp."));
seed.setEnabler(&shuffle);
runDisabled.setSettingsKey("RunDisabled"); runDisabled.setSettingsKey("RunDisabled");
runDisabled.setLabelText(Tr::tr("Run disabled tests")); runDisabled.setLabelText(Tr::tr("Run disabled tests"));
@@ -132,6 +130,11 @@ GTestFramework::GTestFramework()
connect(this, &AspectContainer::applied, this, [] { connect(this, &AspectContainer::applied, this, [] {
TestTreeModel::instance()->rebuild({GTest::Constants::FRAMEWORK_ID}); TestTreeModel::instance()->rebuild({GTest::Constants::FRAMEWORK_ID});
}); });
readSettings();
seed.setEnabler(&shuffle);
iterations.setEnabler(&repeat);
} }
ITestParser *GTestFramework::createTestParser() ITestParser *GTestFramework::createTestParser()

View File

@@ -92,7 +92,6 @@ QtTestFramework::QtTestFramework()
maxWarnings.setRange(0, 10000); maxWarnings.setRange(0, 10000);
maxWarnings.setDefaultValue(2000); maxWarnings.setDefaultValue(2000);
maxWarnings.setSpecialValueText(Tr::tr("Unlimited")); maxWarnings.setSpecialValueText(Tr::tr("Unlimited"));
maxWarnings.setEnabler(&limitWarnings);
quickCheckForDerivedTests.setSettingsKey("QuickCheckForDerivedTests"); quickCheckForDerivedTests.setSettingsKey("QuickCheckForDerivedTests");
quickCheckForDerivedTests.setDefaultValue(false); quickCheckForDerivedTests.setDefaultValue(false);
@@ -100,6 +99,10 @@ QtTestFramework::QtTestFramework()
quickCheckForDerivedTests.setToolTip( quickCheckForDerivedTests.setToolTip(
Tr::tr("Search for Qt Quick tests that are derived from TestCase.\nWarning: Enabling this " Tr::tr("Search for Qt Quick tests that are derived from TestCase.\nWarning: Enabling this "
"feature significantly increases scan time.")); "feature significantly increases scan time."));
readSettings();
maxWarnings.setEnabler(&limitWarnings);
} }
QString QtTestFramework::metricsTypeToOption(const MetricsType type) QString QtTestFramework::metricsTypeToOption(const MetricsType type)

View File

@@ -86,14 +86,4 @@ ITestTool *testToolForBuildSystemId(Id buildSystemId)
}); });
} }
void synchronizeSettings()
{
Internal::testSettings().fromSettings();
for (ITestFramework *framework : std::as_const(testFrameworks()))
framework->readSettings();
for (ITestTool *testTool : std::as_const(testTools()))
testTool->readSettings();
}
} // Autotest::TestframeworkManager } // Autotest::TestframeworkManager

View File

@@ -9,7 +9,6 @@ namespace Autotest::TestFrameworkManager {
void registerTestFramework(ITestFramework *framework); void registerTestFramework(ITestFramework *framework);
void registerTestTool(ITestTool *testTool); void registerTestTool(ITestTool *testTool);
void synchronizeSettings();
ITestFramework *frameworkForId(Utils::Id frameworkId); ITestFramework *frameworkForId(Utils::Id frameworkId);
ITestTool *testToolForId(Utils::Id testToolId); ITestTool *testToolForId(Utils::Id testToolId);

View File

@@ -64,7 +64,6 @@ TestSettings::TestSettings()
resultDescriptionMaxSize.setSettingsKey("ResultDescriptionMaxSize"); resultDescriptionMaxSize.setSettingsKey("ResultDescriptionMaxSize");
resultDescriptionMaxSize.setDefaultValue(10); resultDescriptionMaxSize.setDefaultValue(10);
resultDescriptionMaxSize.setRange(1, 100000); resultDescriptionMaxSize.setRange(1, 100000);
resultDescriptionMaxSize.setEnabler(&limitResultDescription);
autoScroll.setSettingsKey("AutoScrollResults"); autoScroll.setSettingsKey("AutoScrollResults");
autoScroll.setDefaultValue(true); autoScroll.setDefaultValue(true);
@@ -95,7 +94,6 @@ TestSettings::TestSettings()
popupOnFail.setSettingsKey("PopupOnFail"); popupOnFail.setSettingsKey("PopupOnFail");
popupOnFail.setLabelText(Tr::tr("Only for unsuccessful test runs")); popupOnFail.setLabelText(Tr::tr("Only for unsuccessful test runs"));
popupOnFail.setEnabler(&popupOnFinish);
popupOnFail.setToolTip(Tr::tr("Displays test results only if the test run contains " popupOnFail.setToolTip(Tr::tr("Displays test results only if the test run contains "
"failed, fatal or unexpectedly passed tests.")); "failed, fatal or unexpectedly passed tests."));
@@ -105,6 +103,11 @@ TestSettings::TestSettings()
runAfterBuild.addOption(Tr::tr("None")); runAfterBuild.addOption(Tr::tr("None"));
runAfterBuild.addOption(Tr::tr("All")); runAfterBuild.addOption(Tr::tr("All"));
runAfterBuild.addOption(Tr::tr("Selected")); runAfterBuild.addOption(Tr::tr("Selected"));
fromSettings();
resultDescriptionMaxSize.setEnabler(&limitResultDescription);
popupOnFail.setEnabler(&popupOnFinish);
} }
void TestSettings::toSettings() const void TestSettings::toSettings() const

View File

@@ -124,31 +124,7 @@ public:
&& prj->hasMakeInstallEquivalent(); && prj->hasMakeInstallEquivalent();
}); });
addInitialStep(Qdb::Constants::QdbStopApplicationStepId); addInitialStep(Qdb::Constants::QdbStopApplicationStepId);
addInitialStep(RemoteLinux::Constants::GenericDeployStepId, [](Target *target) { addInitialStep(RemoteLinux::Constants::GenericDeployStepId);
auto device = DeviceKitAspect::device(target->kit());
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
if (buildDevice && buildDevice->rootPath().needsDevice())
return false;
return !device || (device
&& device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool());
});
addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) {
auto device = DeviceKitAspect::device(target->kit());
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
if (buildDevice && buildDevice->rootPath().needsDevice())
return false;
return device && !device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool();
});
// This step is for:
// a) A remote build device, as they do not support real rsync yet.
// b) If there is no target device setup yet.
addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) {
auto device = DeviceKitAspect::device(target->kit());
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
if (buildDevice && buildDevice->rootPath().needsDevice())
return true;
return false;
});
} }
}; };

View File

@@ -10,6 +10,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <cppeditor/clangdiagnosticconfigsmodel.h> #include <cppeditor/clangdiagnosticconfigsmodel.h>
#include <cppeditor/cppprojectfile.h>
#include <cppeditor/cpptoolsreuse.h> #include <cppeditor/cpptoolsreuse.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
@@ -76,14 +77,17 @@ static QStringList checksArguments(const AnalyzeInputData &input)
return {}; return {};
} }
static QStringList clangArguments(const ClangDiagnosticConfig &diagnosticConfig, static QStringList clangArguments(const AnalyzeInputData &input)
const QStringList &baseOptions)
{ {
QStringList arguments; QStringList arguments;
const ClangDiagnosticConfig &diagnosticConfig = input.config;
const QStringList &baseOptions = input.unit.arguments;
arguments << ClangDiagnosticConfigsModel::globalDiagnosticOptions() arguments << ClangDiagnosticConfigsModel::globalDiagnosticOptions()
<< (isClMode(baseOptions) ? clangArgsForCl(diagnosticConfig.clangOptions()) << (isClMode(baseOptions) ? clangArgsForCl(diagnosticConfig.clangOptions())
: diagnosticConfig.clangOptions()) : diagnosticConfig.clangOptions())
<< baseOptions; << baseOptions;
if (ProjectFile::isHeader(input.unit.file))
arguments << "-Wno-pragma-once-outside-header";
if (LOG().isDebugEnabled()) if (LOG().isDebugEnabled())
arguments << QLatin1String("-v"); arguments << QLatin1String("-v");
@@ -157,7 +161,7 @@ GroupItem clangToolTask(const AnalyzeInputData &input,
const QStringList args = checksArguments(input) const QStringList args = checksArguments(input)
+ mainToolArguments(data) + mainToolArguments(data)
+ QStringList{"--"} + QStringList{"--"}
+ clangArguments(input.config, input.unit.arguments); + clangArguments(input);
const CommandLine commandLine = {data.executable, args}; const CommandLine commandLine = {data.executable, args};
qCDebug(LOG).noquote() << "Starting" << commandLine.toUserOutput(); qCDebug(LOG).noquote() << "Starting" << commandLine.toUserOutput();

View File

@@ -777,6 +777,9 @@ void CMakeBuildStep::updateDeploymentData()
IDeviceConstPtr runDevice = DeviceKitAspect::device(buildSystem()->kit()); IDeviceConstPtr runDevice = DeviceKitAspect::device(buildSystem()->kit());
if (!runDevice)
return;
const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(), const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(),
[](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); }); [](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); });

View File

@@ -1004,6 +1004,30 @@ void CMakeBuildSystem::updateProjectData()
QtSupport::CppKitInfo kitInfo(kit()); QtSupport::CppKitInfo kitInfo(kit());
QTC_ASSERT(kitInfo.isValid(), return ); QTC_ASSERT(kitInfo.isValid(), return );
struct QtMajorToPkgNames
{
QtMajorVersion major = QtMajorVersion::None;
QStringList pkgNames;
};
auto qtVersionFromCMake = [this](const QList<QtMajorToPkgNames> &mapping) {
for (const QtMajorToPkgNames &m : mapping) {
for (const QString &pkgName : m.pkgNames) {
auto qt = m_findPackagesFilesHash.value(pkgName);
if (qt.hasValidTarget())
return m.major;
}
}
return QtMajorVersion::None;
};
QtMajorVersion qtVersion = kitInfo.projectPartQtVersion;
if (qtVersion == QtMajorVersion::None)
qtVersion = qtVersionFromCMake({{QtMajorVersion::Qt6, {"Qt6", "Qt6Core"}},
{QtMajorVersion::Qt5, {"Qt5", "Qt5Core"}},
{QtMajorVersion::Qt4, {"Qt4", "Qt4Core"}}
});
QString errorMessage; QString errorMessage;
RawProjectParts rpps = m_reader.createRawProjectParts(errorMessage); RawProjectParts rpps = m_reader.createRawProjectParts(errorMessage);
if (!errorMessage.isEmpty()) if (!errorMessage.isEmpty())
@@ -1011,8 +1035,7 @@ void CMakeBuildSystem::updateProjectData()
qCDebug(cmakeBuildSystemLog) << "Raw project parts created." << errorMessage; qCDebug(cmakeBuildSystemLog) << "Raw project parts created." << errorMessage;
for (RawProjectPart &rpp : rpps) { for (RawProjectPart &rpp : rpps) {
rpp.setQtVersion( rpp.setQtVersion(qtVersion); // TODO: Check if project actually uses Qt.
kitInfo.projectPartQtVersion); // TODO: Check if project actually uses Qt.
const FilePath includeFileBaseDir = buildConfiguration()->buildDirectory(); const FilePath includeFileBaseDir = buildConfiguration()->buildDirectory();
QStringList cxxFlags = rpp.flagsForCxx.commandLineFlags; QStringList cxxFlags = rpp.flagsForCxx.commandLineFlags;
QStringList cFlags = rpp.flagsForC.commandLineFlags; QStringList cFlags = rpp.flagsForC.commandLineFlags;
@@ -1769,7 +1792,7 @@ void CMakeBuildSystem::updateQmlJSCodeModel(const QStringList &extraHeaderPaths,
auto addImports = [&projectInfo](const QString &imports) { auto addImports = [&projectInfo](const QString &imports) {
const QStringList importList = CMakeConfigItem::cmakeSplitValue(imports); const QStringList importList = CMakeConfigItem::cmakeSplitValue(imports);
for (const QString &import : importList) for (const QString &import : importList)
projectInfo.importPaths.maybeInsert(FilePath::fromString(import), QmlJS::Dialect::Qml); projectInfo.importPaths.maybeInsert(FilePath::fromUserInput(import), QmlJS::Dialect::Qml);
}; };
const CMakeConfig &cm = configurationFromCMake(); const CMakeConfig &cm = configurationFromCMake();

View File

@@ -116,8 +116,10 @@ static Environment getEnvCombined(const std::optional<Environment> &optPresetEnv
Environment result = env; Environment result = env;
if (optPresetEnv) { if (optPresetEnv) {
optPresetEnv->forEachEntry([&result](const QString &key, const QString &value, bool) { optPresetEnv->forEachEntry([&result](const QString &key, const QString &value,
result.set(key, value); bool enabled) {
if (enabled)
result.set(key, value);
}); });
} }
@@ -128,7 +130,9 @@ template<class PresetType>
void expand(const PresetType &preset, Environment &env, const FilePath &sourceDirectory) void expand(const PresetType &preset, Environment &env, const FilePath &sourceDirectory)
{ {
const Environment presetEnv = getEnvCombined(preset.environment, env); const Environment presetEnv = getEnvCombined(preset.environment, env);
presetEnv.forEachEntry([&](const QString &key, const QString &value_, bool) { presetEnv.forEachEntry([&](const QString &key, const QString &value_, bool enabled) {
if (!enabled)
return;
QString value = value_; QString value = value_;
expandAllButEnv(preset, sourceDirectory, value); expandAllButEnv(preset, sourceDirectory, value);
value = expandMacroEnv("env", value, [presetEnv](const QString &macroName) { value = expandMacroEnv("env", value, [presetEnv](const QString &macroName) {
@@ -163,7 +167,9 @@ template<class PresetType>
void expand(const PresetType &preset, EnvironmentItems &envItems, const FilePath &sourceDirectory) void expand(const PresetType &preset, EnvironmentItems &envItems, const FilePath &sourceDirectory)
{ {
const Environment presetEnv = preset.environment ? *preset.environment : Environment(); const Environment presetEnv = preset.environment ? *preset.environment : Environment();
presetEnv.forEachEntry([&](const QString &key, const QString &value_, bool) { presetEnv.forEachEntry([&](const QString &key, const QString &value_, bool enabled) {
if (!enabled)
return;
QString value = value_; QString value = value_;
expandAllButEnv(preset, sourceDirectory, value); expandAllButEnv(preset, sourceDirectory, value);
value = expandMacroEnv("env", value, [presetEnv](const QString &macroName) { value = expandMacroEnv("env", value, [presetEnv](const QString &macroName) {

View File

@@ -209,14 +209,17 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se
connect(m_codeEditor, &CodeEditorWidget::gotFocus, this, &SourceEditorWidget::gotFocus); connect(m_codeEditor, &CodeEditorWidget::gotFocus, this, &SourceEditorWidget::gotFocus);
TextDocumentPtr document = TextDocumentPtr(new SourceTextDocument(m_sourceSettings, undoStack)); auto sourceTextDocument = settings->sourceTextDocument();
if (!sourceTextDocument)
sourceTextDocument = TextDocumentPtr(new SourceTextDocument(m_sourceSettings, undoStack));
settings->setSourceTextDocument(sourceTextDocument);
connect(document.get(), connect(sourceTextDocument.get(),
&SourceTextDocument::changed, &SourceTextDocument::changed,
this, this,
&SourceEditorWidget::sourceCodeChanged); &SourceEditorWidget::sourceCodeChanged);
m_codeEditor->setTextDocument(document); m_codeEditor->setTextDocument(sourceTextDocument);
m_codeEditor->updateHighlighter(); m_codeEditor->updateHighlighter();
auto addCompilerButton = new QToolButton; auto addCompilerButton = new QToolButton;

View File

@@ -8,6 +8,8 @@
#include <utils/aspects.h> #include <utils/aspects.h>
#include <texteditor/textdocument.h>
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
namespace CompilerExplorer { namespace CompilerExplorer {
@@ -58,6 +60,12 @@ public:
ApiConfigFunction apiConfigFunction() const { return m_apiConfigFunction; } ApiConfigFunction apiConfigFunction() const { return m_apiConfigFunction; }
TextEditor::TextDocumentPtr sourceTextDocument() const { return m_sourceTextDocument; }
void setSourceTextDocument(TextEditor::TextDocumentPtr sourceTextDocument)
{
m_sourceTextDocument = sourceTextDocument;
}
public: public:
Utils::StringSelectionAspect languageId{this}; Utils::StringSelectionAspect languageId{this};
Utils::StringAspect source{this}; Utils::StringAspect source{this};
@@ -75,6 +83,7 @@ private:
private: private:
CompilerExplorerSettings *m_parent; CompilerExplorerSettings *m_parent;
ApiConfigFunction m_apiConfigFunction; ApiConfigFunction m_apiConfigFunction;
TextEditor::TextDocumentPtr m_sourceTextDocument{nullptr};
}; };
class CompilerSettings : public Utils::AspectContainer, class CompilerSettings : public Utils::AspectContainer,

View File

@@ -85,7 +85,6 @@ SystemSettings::SystemSettings()
autoSaveInterval.setSuffix(Tr::tr("min")); autoSaveInterval.setSuffix(Tr::tr("min"));
autoSaveInterval.setRange(1, 1000000); autoSaveInterval.setRange(1, 1000000);
autoSaveInterval.setDefaultValue(5); autoSaveInterval.setDefaultValue(5);
autoSaveInterval.setEnabler(&autoSaveModifiedFiles);
autoSaveInterval.setLabelText(Tr::tr("Interval:")); autoSaveInterval.setLabelText(Tr::tr("Interval:"));
autoSaveAfterRefactoring.setSettingsKey("EditorManager/AutoSaveAfterRefactoring"); autoSaveAfterRefactoring.setSettingsKey("EditorManager/AutoSaveAfterRefactoring");
@@ -107,7 +106,6 @@ SystemSettings::SystemSettings()
autoSuspendMinDocumentCount.setSettingsKey("EditorManager/AutoSuspendMinDocuments"); autoSuspendMinDocumentCount.setSettingsKey("EditorManager/AutoSuspendMinDocuments");
autoSuspendMinDocumentCount.setRange(1, 500); autoSuspendMinDocumentCount.setRange(1, 500);
autoSuspendMinDocumentCount.setDefaultValue(30); autoSuspendMinDocumentCount.setDefaultValue(30);
autoSuspendMinDocumentCount.setEnabler(&autoSuspendEnabled);
autoSuspendMinDocumentCount.setLabelText(Tr::tr("Files to keep open:")); autoSuspendMinDocumentCount.setLabelText(Tr::tr("Files to keep open:"));
autoSuspendMinDocumentCount.setToolTip( autoSuspendMinDocumentCount.setToolTip(
Tr::tr("Minimum number of open documents that should be kept in memory. Increasing this " Tr::tr("Minimum number of open documents that should be kept in memory. Increasing this "
@@ -122,7 +120,6 @@ SystemSettings::SystemSettings()
bigFileSizeLimitInMB.setSuffix(Tr::tr("MB")); bigFileSizeLimitInMB.setSuffix(Tr::tr("MB"));
bigFileSizeLimitInMB.setRange(1, 500); bigFileSizeLimitInMB.setRange(1, 500);
bigFileSizeLimitInMB.setDefaultValue(5); bigFileSizeLimitInMB.setDefaultValue(5);
bigFileSizeLimitInMB.setEnabler(&warnBeforeOpeningBigFiles);
maxRecentFiles.setSettingsKey("EditorManager/MaxRecentFiles"); maxRecentFiles.setSettingsKey("EditorManager/MaxRecentFiles");
maxRecentFiles.setRange(1, 99); maxRecentFiles.setRange(1, 99);
@@ -151,6 +148,11 @@ SystemSettings::SystemSettings()
showCrashButton.setSettingsKey("ShowCrashButton"); showCrashButton.setSettingsKey("ShowCrashButton");
#endif #endif
readSettings(); readSettings();
autoSaveInterval.setEnabler(&autoSaveModifiedFiles);
autoSuspendMinDocumentCount.setEnabler(&autoSuspendEnabled);
bigFileSizeLimitInMB.setEnabler(&warnBeforeOpeningBigFiles);
connect(&autoSaveModifiedFiles, &BaseAspect::changed, connect(&autoSaveModifiedFiles, &BaseAspect::changed,
this, &EditorManagerPrivate::updateAutoSave); this, &EditorManagerPrivate::updateAutoSave);
connect(&autoSaveInterval, &BaseAspect::changed, this, &EditorManagerPrivate::updateAutoSave); connect(&autoSaveInterval, &BaseAspect::changed, this, &EditorManagerPrivate::updateAutoSave);

View File

@@ -1647,8 +1647,8 @@ QList<ProjectPart::ConstPtr> CppModelManager::projectPart(const FilePath &fileNa
{ {
{ {
QReadLocker locker(&d->m_projectLock); QReadLocker locker(&d->m_projectLock);
auto it = d->m_fileToProjectParts.find(fileName); auto it = d->m_fileToProjectParts.constFind(fileName);
if (it != d->m_fileToProjectParts.end()) if (it != d->m_fileToProjectParts.constEnd())
return it.value(); return it.value();
} }
const FilePath canonicalPath = fileName.canonicalPath(); const FilePath canonicalPath = fileName.canonicalPath();

View File

@@ -58,10 +58,13 @@ void DapClient::sendInitialize()
postRequest("initialize", QJsonObject{{"clientID", "QtCreator"}, {"clientName", "QtCreator"}}); postRequest("initialize", QJsonObject{{"clientID", "QtCreator"}, {"clientName", "QtCreator"}});
} }
void DapClient::sendLaunch(const Utils::FilePath &executable) void DapClient::sendLaunch(const Utils::CommandLine &command)
{ {
postRequest("launch", postRequest("launch",
QJsonObject{{"noDebug", false}, {"program", executable.path()}, {"__restart", ""}}); QJsonObject{{"noDebug", false},
{"program", command.executable().path()},
{"args", command.arguments()},
{"__restart", ""}});
} }
void DapClient::sendAttach() void DapClient::sendAttach()

View File

@@ -80,7 +80,7 @@ public:
virtual void sendInitialize(); virtual void sendInitialize();
void sendLaunch(const Utils::FilePath &executable); void sendLaunch(const Utils::CommandLine &command);
void sendAttach(); void sendAttach();
void sendConfigurationDone(); void sendConfigurationDone();

View File

@@ -195,7 +195,7 @@ void DapEngine::handleDapInitialize()
{ {
QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state()); QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state());
m_dapClient->sendLaunch(runParameters().inferior.command.executable()); m_dapClient->sendLaunch(runParameters().inferior.command);
qCDebug(logCategory()) << "handleDapLaunch"; qCDebug(logCategory()) << "handleDapLaunch";
} }
@@ -523,6 +523,9 @@ QString DapEngine::errorMessage(QProcess::ProcessError error) const
void DapEngine::handleDapDone() void DapEngine::handleDapDone()
{ {
if (state() == DebuggerFinished)
return;
if (m_dapClient->dataProvider()->result() == ProcessResult::StartFailed) { if (m_dapClient->dataProvider()->result() == ProcessResult::StartFailed) {
notifyEngineSetupFailed(); notifyEngineSetupFailed();
showMessage("ADAPTER START FAILED"); showMessage("ADAPTER START FAILED");
@@ -812,7 +815,7 @@ void DapEngine::refreshLocals(const QJsonArray &variables)
if (currentItem && currentItem->iname.startsWith("watch")) if (currentItem && currentItem->iname.startsWith("watch"))
currentItem->removeChildren(); currentItem->removeChildren();
for (auto variable : variables) { for (const auto &variable : variables) {
WatchItem *item = new WatchItem; WatchItem *item = new WatchItem;
const QString name = variable.toObject().value("name").toString(); const QString name = variable.toObject().value("name").toString();

View File

@@ -55,6 +55,8 @@ public:
void start() override void start() override
{ {
m_proc.setProcessMode(ProcessMode::Writer); m_proc.setProcessMode(ProcessMode::Writer);
if (m_runParameters.debugger.workingDirectory.isDir())
m_proc.setWorkingDirectory(m_runParameters.debugger.workingDirectory);
m_proc.setEnvironment(m_runParameters.debugger.environment); m_proc.setEnvironment(m_runParameters.debugger.environment);
m_proc.setCommand(m_cmd); m_proc.setCommand(m_cmd);
m_proc.start(); m_proc.start();

View File

@@ -662,9 +662,11 @@ CommandLine DockerDevicePrivate::withDockerExecCmd(const CommandLine &cmd,
dockerCmd.addArg("-t"); dockerCmd.addArg("-t");
if (env) { if (env) {
env->forEachEntry([&](const QString &key, const QString &value, bool) { env->forEachEntry([&](const QString &key, const QString &value, bool enabled) {
dockerCmd.addArg("-e"); if (enabled) {
dockerCmd.addArg(key + "=" + env->expandVariables(value)); dockerCmd.addArg("-e");
dockerCmd.addArg(key + "=" + env->expandVariables(value));
}
}); });
} }

View File

@@ -156,8 +156,6 @@ FakeVimSettings::FakeVimSettings()
Row ints { shiftWidth, tabStop, scrollOff, st }; Row ints { shiftWidth, tabStop, scrollOff, st };
vimRcPath.setEnabler(&readVimRc);
Column strings { Column strings {
backspace, backspace,
isKeyword, isKeyword,
@@ -239,6 +237,8 @@ FakeVimSettings::FakeVimSettings()
readSettings(); readSettings();
vimRcPath.setEnabler(&readVimRc);
#endif #endif
} }

View File

@@ -592,6 +592,11 @@ bool Client::reachable() const
return d->m_state == Initialized; return d->m_state == Initialized;
} }
void Client::resetRestartCounter()
{
d->m_restartsLeft = ClientPrivate::MaxRestarts;
}
void Client::setClientInfo(const LanguageServerProtocol::ClientInfo &clientInfo) void Client::setClientInfo(const LanguageServerProtocol::ClientInfo &clientInfo)
{ {
d->m_clientInfo = clientInfo; d->m_clientInfo = clientInfo;

View File

@@ -86,6 +86,7 @@ public:
State state() const; State state() const;
QString stateString() const; QString stateString() const;
bool reachable() const; bool reachable() const;
void resetRestartCounter();
void setClientInfo(const LanguageServerProtocol::ClientInfo &clientInfo); void setClientInfo(const LanguageServerProtocol::ClientInfo &clientInfo);
// capabilities // capabilities

View File

@@ -159,6 +159,7 @@ void LanguageClientManager::clientFinished(Client *client)
QTC_ASSERT(managerInstance, return); QTC_ASSERT(managerInstance, return);
if (managerInstance->m_restartingClients.remove(client)) { if (managerInstance->m_restartingClients.remove(client)) {
client->resetRestartCounter();
client->reset(); client->reset();
client->start(); client->start();
return; return;

View File

@@ -6,6 +6,7 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <QDir>
#include <QString> #include <QString>
#include <QVector> #include <QVector>
@@ -22,7 +23,8 @@ class HeaderPath
{ {
public: public:
HeaderPath() = default; HeaderPath() = default;
HeaderPath(const QString &path, HeaderPathType type) : path(path), type(type) { } HeaderPath(const QString &path, HeaderPathType type)
: path(QDir::fromNativeSeparators(path)), type(type) { }
HeaderPath(const char *path, HeaderPathType type) : HeaderPath(QLatin1String(path), type) {} HeaderPath(const char *path, HeaderPathType type) : HeaderPath(QLatin1String(path), type) {}
HeaderPath(const Utils::FilePath &path, HeaderPathType type) HeaderPath(const Utils::FilePath &path, HeaderPathType type)
: HeaderPath(path.path(), type) : HeaderPath(path.path(), type)

View File

@@ -867,8 +867,9 @@ QtSupport::ProFileReader *QmakeBuildSystem::createProFileReader(const QmakeProFi
rootProFileName, rootProFileName,
deviceRoot()); deviceRoot());
env.forEachEntry([&](const QString &key, const QString &value, bool) { env.forEachEntry([&](const QString &key, const QString &value, bool enabled) {
m_qmakeGlobals->environment.insert(key, env.expandVariables(value)); if (enabled)
m_qmakeGlobals->environment.insert(key, env.expandVariables(value));
}); });
m_qmakeGlobals->setCommandLineArguments(rootProFileName, qmakeArgs); m_qmakeGlobals->setCommandLineArguments(rootProFileName, qmakeArgs);

View File

@@ -40,7 +40,6 @@ QmlProfilerSettings::QmlProfilerSettings()
flushInterval.setRange(1, 10000000); flushInterval.setRange(1, 10000000);
flushInterval.setDefaultValue(1000); flushInterval.setDefaultValue(1000);
flushInterval.setLabelText(Tr::tr("Flush interval (ms):")); flushInterval.setLabelText(Tr::tr("Flush interval (ms):"));
flushInterval.setEnabler(&flushEnabled);
lastTraceFile.setSettingsKey("Analyzer.QmlProfiler.LastTraceFile"); lastTraceFile.setSettingsKey("Analyzer.QmlProfiler.LastTraceFile");
@@ -63,6 +62,8 @@ QmlProfilerSettings::QmlProfilerSettings()
}); });
readSettings(); readSettings();
flushInterval.setEnabler(&flushEnabled);
} }
// QmlProfilerSettingsPage // QmlProfilerSettingsPage

View File

@@ -41,7 +41,6 @@ CodeGenSettings::CodeGenSettings()
addQtVersionCheck.setSettingsKey("AddQtVersionCheck"); addQtVersionCheck.setSettingsKey("AddQtVersionCheck");
addQtVersionCheck.setLabelText(Tr::tr("Add Qt version #ifdef for module names")); addQtVersionCheck.setLabelText(Tr::tr("Add Qt version #ifdef for module names"));
addQtVersionCheck.setEnabler(&includeQtModule);
setLayouter([this] { setLayouter([this] {
using namespace Layouting; using namespace Layouting;
@@ -66,6 +65,7 @@ CodeGenSettings::CodeGenSettings()
readSettings(); readSettings();
addQtVersionCheck.setEnabler(&includeQtModule);
} }
class CodeGenSettingsPage final : public Core::IOptionsPage class CodeGenSettingsPage final : public Core::IOptionsPage

View File

@@ -768,8 +768,9 @@ CommandLine SshProcessInterfacePrivate::fullLocalCommandLine() const
inner.addArgs(QString("echo ") + s_pidMarker + "$$" + s_pidMarker + " && ", CommandLine::Raw); inner.addArgs(QString("echo ") + s_pidMarker + "$$" + s_pidMarker + " && ", CommandLine::Raw);
const Environment &env = q->m_setup.m_environment; const Environment &env = q->m_setup.m_environment;
env.forEachEntry([&](const QString &key, const QString &value, bool) { env.forEachEntry([&](const QString &key, const QString &value, bool enabled) {
inner.addArgs(key + "='" + env.expandVariables(value) + '\'', CommandLine::Raw); if (enabled)
inner.addArgs(key + "='" + env.expandVariables(value) + '\'', CommandLine::Raw);
}); });
if (!useTerminal && !commandLine.isEmpty()) if (!useTerminal && !commandLine.isEmpty())

View File

@@ -113,7 +113,6 @@ ScreenRecorderSettings::ScreenRecorderSettings()
fileSizeLimit.setDefaultValue(1024); fileSizeLimit.setDefaultValue(1024);
fileSizeLimit.setRange(100, 1024 * 1024 * 2); // Up to 2GB fileSizeLimit.setRange(100, 1024 * 1024 * 2); // Up to 2GB
fileSizeLimit.setSuffix("MB"); fileSizeLimit.setSuffix("MB");
fileSizeLimit.setEnabler(&enableFileSizeLimit);
enableRtBuffer.setSettingsKey("EnableRealTimeBuffer"); enableRtBuffer.setSettingsKey("EnableRealTimeBuffer");
enableRtBuffer.setDefaultValue(true); enableRtBuffer.setDefaultValue(true);
@@ -124,7 +123,6 @@ ScreenRecorderSettings::ScreenRecorderSettings()
rtBufferSize.setDefaultValue(1024); rtBufferSize.setDefaultValue(1024);
rtBufferSize.setRange(100, 1024 * 1024 * 2); // Up to 2GB rtBufferSize.setRange(100, 1024 * 1024 * 2); // Up to 2GB
rtBufferSize.setSuffix("MB"); rtBufferSize.setSuffix("MB");
rtBufferSize.setEnabler(&enableRtBuffer);
logFfmpegCommandline.setSettingsKey("LogFFMpegCommandLine"); logFfmpegCommandline.setSettingsKey("LogFFMpegCommandLine");
logFfmpegCommandline.setDefaultValue(false); logFfmpegCommandline.setDefaultValue(false);
@@ -206,6 +204,9 @@ ScreenRecorderSettings::ScreenRecorderSettings()
readSettings(); readSettings();
rtBufferSize.setEnabler(&enableRtBuffer);
fileSizeLimit.setEnabler(&enableFileSizeLimit);
setCaptureMouseClicksVisible(); setCaptureMouseClicksVisible();
connect(&screenCaptureType, &SelectionAspect::volatileValueChanged, this, connect(&screenCaptureType, &SelectionAspect::volatileValueChanged, this,
setCaptureMouseClicksVisible); setCaptureMouseClicksVisible);

View File

@@ -103,7 +103,6 @@ add_qtc_plugin(TextEditor
texteditor.qrc texteditor.qrc
texteditor_global.h texteditor_global.h
texteditortr.h texteditortr.h
texteditor_p.h
texteditoractionhandler.cpp texteditoractionhandler.h texteditoractionhandler.cpp texteditoractionhandler.h
texteditorconstants.cpp texteditorconstants.h texteditorconstants.cpp texteditorconstants.h
texteditoroverlay.cpp texteditoroverlay.h texteditoroverlay.cpp texteditoroverlay.h

View File

@@ -120,8 +120,10 @@ OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) :
m_toggleSort->setToolTip(Tr::tr("Sort Alphabetically")); m_toggleSort->setToolTip(Tr::tr("Sort Alphabetically"));
connect(m_toggleSort, &QAbstractButton::clicked, this, &OutlineWidgetStack::toggleSort); connect(m_toggleSort, &QAbstractButton::clicked, this, &OutlineWidgetStack::toggleSort);
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged, connect(Core::EditorManager::instance(),
this, &OutlineWidgetStack::updateEditor); &Core::EditorManager::currentEditorChanged,
this,
&OutlineWidgetStack::updateCurrentEditor);
connect(factory, &OutlineFactory::updateOutline, connect(factory, &OutlineFactory::updateOutline,
this, &OutlineWidgetStack::updateCurrentEditor); this, &OutlineWidgetStack::updateCurrentEditor);
updateCurrentEditor(); updateCurrentEditor();

View File

@@ -27,7 +27,6 @@
#include "tabsettings.h" #include "tabsettings.h"
#include "textdocument.h" #include "textdocument.h"
#include "textdocumentlayout.h" #include "textdocumentlayout.h"
#include "texteditor_p.h"
#include "texteditoractionhandler.h" #include "texteditoractionhandler.h"
#include "texteditorconstants.h" #include "texteditorconstants.h"
#include "texteditoroverlay.h" #include "texteditoroverlay.h"
@@ -563,6 +562,19 @@ struct PaintEventBlockData
struct ExtraAreaPaintEventData; struct ExtraAreaPaintEventData;
struct TextEditorPrivateHighlightBlocks
{
QList<int> open;
QList<int> close;
QList<int> visualIndent;
inline int count() const { return visualIndent.size(); }
inline bool isEmpty() const { return open.isEmpty() || close.isEmpty() || visualIndent.isEmpty(); }
inline bool operator==(const TextEditorPrivateHighlightBlocks &o) const {
return (open == o.open && close == o.close && visualIndent == o.visualIndent);
}
inline bool operator!=(const TextEditorPrivateHighlightBlocks &o) const { return !(*this == o); }
};
class TextEditorWidgetPrivate : public QObject class TextEditorWidgetPrivate : public QObject
{ {
public: public:

View File

@@ -134,7 +134,6 @@ QtcPlugin {
"texteditor.h", "texteditor.h",
"texteditor.qrc", "texteditor.qrc",
"texteditor_global.h", "texteditortr.h", "texteditor_global.h", "texteditortr.h",
"texteditor_p.h",
"texteditoractionhandler.cpp", "texteditoractionhandler.cpp",
"texteditoractionhandler.h", "texteditoractionhandler.h",
"texteditorconstants.cpp", "texteditorconstants.cpp",

View File

@@ -1,36 +0,0 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "texteditor_global.h"
#include <QList>
#include <QTextCursor>
namespace TextEditor {
class TextDocument;
namespace Internal {
//
// TextEditorPrivate
//
struct TextEditorPrivateHighlightBlocks
{
QList<int> open;
QList<int> close;
QList<int> visualIndent;
inline int count() const { return visualIndent.size(); }
inline bool isEmpty() const { return open.isEmpty() || close.isEmpty() || visualIndent.isEmpty(); }
inline bool operator==(const TextEditorPrivateHighlightBlocks &o) const {
return (open == o.open && close == o.close && visualIndent == o.visualIndent);
}
inline bool operator!=(const TextEditorPrivateHighlightBlocks &o) const { return !(*this == o); }
};
} // namespace Internal
} // namespace TextEditor

View File

@@ -28,6 +28,11 @@ public:
private slots: private slots:
void test(); void test();
void test_data(); void test_data();
void reformatter_data();
void reformatter();
private:
}; };
tst_Reformatter::tst_Reformatter() tst_Reformatter::tst_Reformatter()
@@ -41,10 +46,18 @@ void tst_Reformatter::test_data()
{ {
QTest::addColumn<QString>("path"); QTest::addColumn<QString>("path");
// This test performs line-by-line comparison and fails if reformatting
// makes a change inline, for example whitespace removal. We omit
// those files in this test.
QSet<QString> excludedFiles;
excludedFiles << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.qml";
excludedFiles << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.formatted.qml";
QDirIterator it(TESTSRCDIR, QStringList() << QLatin1String("*.qml") << QLatin1String("*.js"), QDir::Files); QDirIterator it(TESTSRCDIR, QStringList() << QLatin1String("*.qml") << QLatin1String("*.js"), QDir::Files);
while (it.hasNext()) { while (it.hasNext()) {
const QString fileName = it.next(); const QString fileName = it.next();
QTest::newRow(fileName.toLatin1()) << it.filePath(); if (!excludedFiles.contains(fileName))
QTest::newRow(fileName.toLatin1()) << it.filePath();
} }
} }
@@ -84,6 +97,44 @@ void tst_Reformatter::test()
QCOMPARE(sourceLines.size(), newLines.size()); QCOMPARE(sourceLines.size(), newLines.size());
} }
void tst_Reformatter::reformatter_data()
{
QTest::addColumn<QString>("filePath");
QTest::addColumn<QString>("formattedFilePath");
QTest::newRow("typeAnnotations")
<< QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.qml"
<< QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.formatted.qml";
}
void tst_Reformatter::reformatter()
{
QFETCH(QString, filePath);
QFETCH(QString, formattedFilePath);
Utils::FilePath fPath = Utils::FilePath::fromString(filePath);
Document::MutablePtr doc
= Document::create(fPath, ModelManagerInterface::guessLanguageOfFile(fPath));
QString fileContent;
{
QFile file(filePath);
QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
fileContent = QString::fromUtf8(file.readAll());
}
doc->setSource(fileContent);
doc->parse();
QString expected;
{
QFile file(formattedFilePath);
QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
expected = QString::fromUtf8(file.readAll());
}
QString formatted = reformat(doc);
QCOMPARE(formatted, expected);
}
QTEST_GUILESS_MAIN(tst_Reformatter); QTEST_GUILESS_MAIN(tst_Reformatter);
#include "tst_reformatter.moc" #include "tst_reformatter.moc"

View File

@@ -0,0 +1,18 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick
Text {
function aaa(t: int, k: double): int {
return 42
}
function bbb(aaa): int {
return 42
}
function abc(cba: int) {
return 42
}
}

View File

@@ -0,0 +1,17 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick
Text {
function aaa (t : int, k : double) : int {
return 42;
}
function bbb(aaa)
: int {return 42}
function abc (cba : int) {
return 42;
}
}

View File

@@ -48,6 +48,11 @@ public:
p.waitForFinished(); p.waitForFinished();
return {p.exitCode(), p.readAllStandardOutput(), p.readAllStandardError()}; return {p.exitCode(), p.readAllStandardOutput(), p.readAllStandardError()};
} }
void findUsingLs(const QString &current, const FileFilter &filter, QStringList *found)
{
UnixDeviceFileAccess::findUsingLs(current, filter, found, {});
}
}; };
class tst_unixdevicefileaccess : public QObject class tst_unixdevicefileaccess : public QObject
@@ -69,6 +74,27 @@ private slots:
QCOMPARE(size, 1024); QCOMPARE(size, 1024);
} }
void findUsingLs()
{
QStringList result;
m_dfa.findUsingLs(m_tempDir.path(),
{{}, QDir::NoFilter, QDirIterator::Subdirectories},
&result);
QCOMPARE(result, QStringList({".", "..", "size-test"}));
QDir tDir(m_tempDir.path());
tDir.mkdir("lsfindsubdir");
result.clear();
m_dfa.findUsingLs(m_tempDir.path(),
{{}, QDir::NoFilter, QDirIterator::Subdirectories},
&result);
QCOMPARE(result,
QStringList(
{".", "..", "lsfindsubdir/.", "lsfindsubdir/..", "lsfindsubdir", "size-test"}));
}
private: private:
TestDFA m_dfa; TestDFA m_dfa;
DeviceFileAccess *m_dfaPtr = &m_dfa; DeviceFileAccess *m_dfaPtr = &m_dfa;

View File

@@ -12,6 +12,7 @@ add_subdirectory(fakevim)
# add_subdirectory(genericproject) # add_subdirectory(genericproject)
add_subdirectory(pluginview) add_subdirectory(pluginview)
add_subdirectory(proparser) add_subdirectory(proparser)
add_subdirectory(terminal)
# add_subdirectory(qml) # add_subdirectory(qml)
# add_subdirectory(qt4projectmanager) # add_subdirectory(qt4projectmanager)
# add_subdirectory(search) # add_subdirectory(search)

Some files were not shown because too many files have changed in this diff Show More