Merge "Merge remote-tracking branch 'origin/12.0' into qds/dev" into qds/dev
27
dist/changelog/changes-12.0.0.md
vendored
@@ -145,6 +145,12 @@ Editing
|
||||
|
||||
### 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
|
||||
([QTCREATORBUG-29601](https://bugreports.qt.io/browse/QTCREATORBUG-29601))
|
||||
* Language Server
|
||||
@@ -237,6 +243,8 @@ Projects
|
||||
* Fixed issues with the subdirectory structure of the project tree
|
||||
([QTCREATORBUG-23942](https://bugreports.qt.io/browse/QTCREATORBUG-23942),
|
||||
[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
|
||||
* Fixed that variables were not expanded for `cmakeExecutable`
|
||||
([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
|
||||
([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
|
||||
|
||||
* Added the generation of code for `CMakeLists.txt`
|
||||
* Added parsing the dependencies from `vcpkg.json` manifest files
|
||||
* 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
|
||||
|
||||
* Added a wizard for Qt Safe Renderer 2.1 and later
|
||||
@@ -277,6 +292,11 @@ Debugging
|
||||
* Added support for remote Linux debugging with LLDB
|
||||
* Fixed warnings about index cache permissions
|
||||
([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
|
||||
--------
|
||||
@@ -323,10 +343,17 @@ Test Integration
|
||||
* Added an option for the number of threads used for scanning
|
||||
([QTCREATORBUG-29301](https://bugreports.qt.io/browse/QTCREATORBUG-29301))
|
||||
* Improved the wizards for `GTest` and `Catch2`
|
||||
* CTest
|
||||
* Enabled colored test output
|
||||
|
||||
Platforms
|
||||
---------
|
||||
|
||||
### macOS
|
||||
|
||||
* Fixed running and debugging in an external terminal
|
||||
([QTCREATORBUG-29246](https://bugreports.qt.io/browse/QTCREATORBUG-29246))
|
||||
|
||||
### Android
|
||||
|
||||
* Fixed issues when `LIBRARY_OUTPUT_DIRECTORY` is set in the CMake build files
|
||||
|
||||
BIN
doc/qtcreator/images/icons/cmake.png
Normal file
|
After Width: | Height: | Size: 293 B |
BIN
doc/qtcreator/images/icons/vcpkg.png
Normal file
|
After Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 16 KiB |
BIN
doc/qtcreator/images/qtcreator-baremetal-eblink.webp
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 17 KiB |
BIN
doc/qtcreator/images/qtcreator-baremetal-jlink.webp
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 15 KiB |
BIN
doc/qtcreator/images/qtcreator-baremetal-openocd.webp
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 14 KiB |
BIN
doc/qtcreator/images/qtcreator-baremetal-stlink.webp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
doc/qtcreator/images/qtcreator-edit-environment.webp
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
BIN
doc/qtcreator/images/qtcreator-preferences-debugger-gdb.webp
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
BIN
doc/qtcreator/images/qtcreator-projects-environment.webp
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
doc/qtcreator/images/qtcreator-vcpkg-cmake-config.webp
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 5.8 KiB |
@@ -59,8 +59,9 @@
|
||||
\section1 Specifying Settings for Debug Server Providers
|
||||
|
||||
To create connections to bare metal devices using a debug server provider,
|
||||
select \preferences > \uicontrol Devices
|
||||
> \uicontrol {Bare Metal} > \uicontrol Add > \uicontrol Default.
|
||||
select \preferences > \uicontrol Devices > \uicontrol {Bare Metal} >
|
||||
\uicontrol Add.
|
||||
|
||||
The available settings depend on the debug server provider.
|
||||
|
||||
\section2 EBlink
|
||||
@@ -68,7 +69,7 @@
|
||||
\l{https://github.com/EmBitz/EBlink}{EBlink} is an ARM Cortex-M debug tool
|
||||
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:
|
||||
|
||||
@@ -105,7 +106,7 @@
|
||||
\l{https://www.segger.com/products/debug-probes/j-link/}{J-Link} is a line
|
||||
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:
|
||||
|
||||
@@ -137,7 +138,7 @@
|
||||
(JTAG) facility. It enables source level debugging with the GDB compiled
|
||||
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:
|
||||
|
||||
@@ -163,7 +164,7 @@
|
||||
\l{https://www.st.com/en/development-tools/stm32-programmers.html#products}
|
||||
{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:
|
||||
|
||||
@@ -202,7 +203,7 @@
|
||||
|
||||
\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
|
||||
|
||||
@@ -215,11 +216,11 @@
|
||||
|
||||
\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"
|
||||
|
||||
To specify settings for uVision St-Link Debugger:
|
||||
To specify settings for uVision St-Link or JLink Debugger:
|
||||
|
||||
\list 1
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
//! [baremetal-common]
|
||||
@@ -6,6 +6,8 @@
|
||||
\li In the \uicontrol Name field, enter a name for the connection.
|
||||
\li In the \uicontrol {Startup mode} field, select the mode to start
|
||||
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
|
||||
to connect to the debug server provider.
|
||||
\li In the \uicontrol {Executable file} field, enter the path to the
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
the selection, click anywhere in the view.
|
||||
|
||||
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}.
|
||||
While building, the button text changes to \uicontrol {Stop CMake}. Select
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
To specify settings for managing the GDB process, select \preferences >
|
||||
\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
|
||||
number of seconds to wait in the \uicontrol {GDB timeout} field. The default
|
||||
@@ -111,6 +111,8 @@
|
||||
To execute arbitrary Python scripts, use
|
||||
\c {python execfile('/path/to/script.py')}.
|
||||
|
||||
\section2 Extended GDB Settings
|
||||
|
||||
The settings in the \uicontrol Extended group give access to advanced
|
||||
or experimental functions of GDB.
|
||||
Enabling them may negatively impact your debugging experience, so use
|
||||
|
||||
@@ -1368,7 +1368,7 @@
|
||||
\uicontrol Debugger > \uicontrol GDB > \uicontrol {Load system GDB pretty
|
||||
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
|
||||
|
||||
@@ -2036,7 +2036,7 @@
|
||||
when loading the same binary in the future. Select \preferences >
|
||||
\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
|
||||
|
||||
|
||||
@@ -197,12 +197,13 @@
|
||||
\if defined(qtcreator)
|
||||
Also specify a text string or C++ or QML code construct
|
||||
in the snippet editor, depending on the snippet category.
|
||||
|
||||
You can use \l{Use Qt Creator variables}{predefined variables} in
|
||||
snippets.
|
||||
\else
|
||||
Also specify a text string or QML code in the snippet editor, depending on
|
||||
the snippet category.
|
||||
\endif
|
||||
You can use \l{Using Qt Creator Variables}{predefined variables} in
|
||||
snippets.
|
||||
|
||||
The snippet editor offers:
|
||||
|
||||
@@ -299,8 +300,6 @@
|
||||
\preferences > \uicontrol Nim > \uicontrol Tools,
|
||||
and enter the path to the tool executable in the \uicontrol Path field.
|
||||
|
||||
\sa {Document code}
|
||||
\else
|
||||
\include qtcreator-variables.qdocinc qtcreator variables
|
||||
\sa {Document code}, {Use Qt Creator variables}
|
||||
\endif
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
// **********************************************************************
|
||||
@@ -57,11 +57,11 @@
|
||||
\li Select \preferences >
|
||||
\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
|
||||
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
|
||||
types of the files to beautify, separated by semicolons. Leave the
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
\li In the \uicontrol Name field, enter a name for the language server.
|
||||
Select the \inlineimage icons/replace.png
|
||||
(\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
|
||||
\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
|
||||
@@ -113,7 +113,7 @@
|
||||
\li In the \uicontrol Name field, enter a name for the language server.
|
||||
Select the \inlineimage icons/replace.png
|
||||
(\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 Language Server} field, enter the path to
|
||||
the Java language server \c .jar file. You can download the Java
|
||||
|
||||
@@ -35,10 +35,12 @@
|
||||
|
||||
\image qtcreator-external-tools.png
|
||||
|
||||
\if defined(qtcreator)
|
||||
Select the \inlineimage icons/replace.png
|
||||
(\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.
|
||||
\endif
|
||||
|
||||
To configure external tools:
|
||||
|
||||
@@ -71,8 +73,8 @@
|
||||
|
||||
\if defined(qtcreator)
|
||||
\li In the \uicontrol {Base environment} field, select whether to run
|
||||
the tool in the system environment or the \l{Build Environment}
|
||||
{build environment} or \l {Selecting the Run Environment}
|
||||
the tool in the system environment or the \l{Specify the environment for projects}
|
||||
{build environment} or \l {Specify the run environment}
|
||||
{run environment} of the active project. Select the build or run
|
||||
environment if the system environment does not have the necessary
|
||||
PATH settings to find the tool chain, for example.
|
||||
@@ -82,20 +84,12 @@
|
||||
|
||||
\li In the \uicontrol Environment field, select \uicontrol Change to modify
|
||||
environment variable values for build and run environments in
|
||||
the \uicontrol {Edit Environment Changes} dialog.
|
||||
\if defined(qtcreator)
|
||||
For more information about how to add and remove variable values,
|
||||
see \l{Batch Editing}.
|
||||
\endif
|
||||
|
||||
the \uicontrol {Edit Environment} dialog.
|
||||
|
||||
To globally change the system 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.
|
||||
\if defined(qtcreator)
|
||||
For more information, see \l{Specifying Environment Settings}.
|
||||
\endif
|
||||
|
||||
\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
|
||||
@@ -121,6 +115,11 @@
|
||||
configuration file to the folder.
|
||||
|
||||
\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
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
||||
@@ -412,7 +412,7 @@
|
||||
|
||||
\list 1
|
||||
\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
|
||||
the number of files to show.
|
||||
\endlist
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
\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
|
||||
manager into \QC.
|
||||
@@ -36,16 +36,31 @@
|
||||
Select \inlineimage icons/online.png
|
||||
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:
|
||||
|
||||
\list 1
|
||||
\li Select \uicontrol File > \uicontrol {New File} >
|
||||
\uicontrol Vcpkg.
|
||||
\image qtcreator-file-new-file-vcpkg-manifest-file.webp {vcpkg.json Manifest File wizard page}
|
||||
\uicontrol vcpkg > \uicontrol {vcpkg.json Manifest File} >
|
||||
\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 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.
|
||||
|
||||
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
|
||||
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:
|
||||
|
||||
\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:
|
||||
|
||||
\list 1
|
||||
\li Place the cursor on the line where you want to add a package.
|
||||
\li Select the \inlineimage icons/zoom.png
|
||||
(\uicontrol {Search Package}) button.
|
||||
\image qtcreator-vcpkg-package-selector.webp {Package selector dialog}
|
||||
\li Select the \inlineimage icons/vcpkg.png
|
||||
(\uicontrol {Add vcpkg Package}) button on the manifest editor
|
||||
toolbar.
|
||||
\image qtcreator-vcpkg-package-selector.webp {Add vcpkg Package dialog}
|
||||
\li Select the package to add to your project.
|
||||
\li Select \uicontrol OK to return to the editor.
|
||||
\li Repeat to add more packages.
|
||||
\endlist
|
||||
|
||||
To set the path to the directory where you installed vcpkg, select
|
||||
\inlineimage icons/settings.png
|
||||
(\uicontrol Configure) on the editor toolbar.
|
||||
\section1 Generate code for CMake configuration files
|
||||
|
||||
\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}
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
You can connect iOS devices to your local machine with a USB cable to
|
||||
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,
|
||||
you already have the tool chain for building applications for iOS. \QC
|
||||
automatically detects the tool chain and creates the necessary
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
\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
|
||||
you should already have the tool chain for building applications for
|
||||
iOS. \QC automatically detects the tool chain and creates the necessary
|
||||
|
||||
@@ -69,8 +69,7 @@
|
||||
\li \image ok.png
|
||||
\endtable
|
||||
|
||||
\note UWP support was removed from \QC 8.0.
|
||||
To develop for UWP using Qt 5, use \QC 7.0, or earlier.
|
||||
\note Deployment, running, and debugging on iOS 17 devices are not supported.
|
||||
|
||||
\QC automatically runs scheduled checks for updates based on the settings
|
||||
specified in \preferences > \uicontrol Environment > \uicontrol Update.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
checkbox.
|
||||
|
||||
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})
|
||||
button.
|
||||
|
||||
|
||||
@@ -65,8 +65,7 @@
|
||||
\li Class and script files for Python projects.
|
||||
\row
|
||||
\li \uicontrol {vcpkg} (experimental)
|
||||
\li \l {Managing Packages with vcpkg}{vcpkg package manager} manifest
|
||||
files (vcpkg.json).
|
||||
\li vcpkg package manager manifest files (vcpkg.json).
|
||||
\row
|
||||
\li \uicontrol {Nim} (experimental)
|
||||
\li Empty Nim source and script files.
|
||||
@@ -74,7 +73,7 @@
|
||||
|
||||
\sa {Create compiler explorer sessions}, {Create C++ classes},
|
||||
{Create OpenGL fragment and vertex shaders}, {Create resource files},
|
||||
{Use project wizards}
|
||||
{Create vcpkg manifest files}, {Use project wizards}
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
\li Select \uicontrol Change to modify environment variable values for
|
||||
build environments in the \uicontrol {Edit Environment Changes}
|
||||
dialog. For more information about how to add and remove variable
|
||||
values, see \l{Batch Editing}.
|
||||
values, see \l{Batch edit environment settings}.
|
||||
\row
|
||||
\li \uicontrol {Force UTF-8 MSVC compiler output}
|
||||
\li Either switches the language of MSVC to English or keeps the
|
||||
|
||||
@@ -110,10 +110,8 @@
|
||||
tested or grouping commands, are not supported because the value of the
|
||||
\uicontrol Executable field is always placed first when constructing the command.
|
||||
|
||||
You can use \l {Using Environment Variables}{environment variables} as
|
||||
values in the fields. In addition, you can \l {Using Qt Creator Variables}
|
||||
{use \QC variables} in arguments, executable paths, and working
|
||||
directories.
|
||||
You can \l {Use Qt Creator variables}{use \QC variables} in arguments,
|
||||
executable paths, and working directories.
|
||||
|
||||
\section1 Build Steps
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
/*!
|
||||
\previouspage creator-build-dependencies.html
|
||||
\page creator-project-settings-environment.html
|
||||
\nextpage creator-custom-output-parsers.html
|
||||
\page creator-how-set-project-environment.html
|
||||
\previouspage creator-how-tos.html
|
||||
|
||||
\title Specifying Environment Settings
|
||||
\ingroup creator-how-to-projects
|
||||
|
||||
You can specify the environment you want to use for building
|
||||
a project in the \uicontrol {Build Environment} section of
|
||||
the \uicontrol {Build Settings}.
|
||||
\title Specify the environment for projects
|
||||
|
||||
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
|
||||
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
|
||||
based on your project requirements.
|
||||
|
||||
To globally change the system 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 final environment is specified separately for each kit. With
|
||||
project-specific environment settings you can change the environment for
|
||||
all kits that you use to build, deploy, and run the project simultaneously,
|
||||
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
|
||||
\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.
|
||||
\section1 Globally change the environment
|
||||
|
||||
\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}
|
||||
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.
|
||||
\image qtcreator-preferences-environment-system.webp "Environment preferences System tab"
|
||||
|
||||
\section1 Batch Editing
|
||||
\section1 Change the environment for a project
|
||||
|
||||
To modify environment variable values for build or run environments,
|
||||
select \uicontrol {Batch Edit} in the \uicontrol {Build Environment}
|
||||
or \uicontrol {Environment} pane and enter environment variables in
|
||||
the \uicontrol {Edit Environment} dialog.
|
||||
To change the system environment for a project from the one in which
|
||||
\QC is started, select \uicontrol Projects > \uicontrol {Project Settings}
|
||||
> \uicontrol Environment.
|
||||
|
||||
\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.
|
||||
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
|
||||
of the line.
|
||||
|
||||
\section1 Clearing the System 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 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
|
||||
\sa {Specify the environment for projects}, {Specifying Build Settings},
|
||||
{Use Qt Creator variables}
|
||||
*/
|
||||
|
||||
@@ -14,13 +14,12 @@
|
||||
|
||||
\title Configuring Projects
|
||||
|
||||
When you install Qt for a target platform, such as Android or QNX,
|
||||
\l{https://www.qt.io/download-qt-installer}{\QOI}
|
||||
creates \l{glossary-buildandrun-kit}{kits} for the development
|
||||
targets.
|
||||
When you install Qt for a development or target platform, such as Linux,
|
||||
\macos, Windows, Android or QNX, \l{https://www.qt.io/download-qt-installer}
|
||||
{\QOI} creates \l{glossary-buildandrun-kit}{kits} for the development targets.
|
||||
|
||||
Select the kits to use in the \uicontrol {Configure Projects}
|
||||
view when you open a project for the first time. At least one kit must be
|
||||
Select the kits to use for a project in the \uicontrol {Configure Projects}
|
||||
view when you open the project for the first time. At least one kit must be
|
||||
active.
|
||||
|
||||
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}
|
||||
|
||||
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
|
||||
|
||||
@@ -45,7 +44,7 @@
|
||||
\li \l{Specify dependencies}{Dependencies}
|
||||
\li \l{Document code}{Documentation Comments}
|
||||
\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{To-Do Entries}{To-Do} (experimental)
|
||||
\endlist
|
||||
@@ -69,7 +68,7 @@
|
||||
lists the kits that are compatible with your project. To activate one or more
|
||||
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 >
|
||||
\uicontrol Kits. Warning and error icons indicate that the kit configuration
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
To run with special environment variables set up, select them in the
|
||||
\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
|
||||
linker will look for libraries that the application links to. By
|
||||
|
||||
@@ -95,31 +95,6 @@
|
||||
\include creator-projects-settings-run-qnx.qdocinc run settings qnx
|
||||
\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
|
||||
|
||||
If you use CMake, Meson or the generic project type in \QC, or want
|
||||
|
||||
@@ -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
|
||||
|
||||
/*!
|
||||
//! [qtcreator variables]
|
||||
\section1 Using Qt Creator Variables
|
||||
\page creator-how-to-use-qtc-variables.html
|
||||
\previouspage creator-how-tos.html
|
||||
|
||||
You can use \QC variables in arguments, executable paths, and working
|
||||
directories. The variables take care of quoting their expansions, so you do
|
||||
not need to put them in quotes.
|
||||
\ingroup creator-how-to-projects
|
||||
|
||||
\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
|
||||
(\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
|
||||
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
|
||||
variables: %{Env:VARNAME}.
|
||||
@@ -38,7 +44,7 @@
|
||||
backreferences. For example, if \c %{variable} is \c my123var, then
|
||||
\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
|
||||
to be a file path, in which case forward slashes might get translated
|
||||
to backslashes on Windows hosts.
|
||||
@@ -48,5 +54,6 @@
|
||||
\badcode
|
||||
%{variable:-default}
|
||||
\endcode
|
||||
//! [qtcreator variables]
|
||||
|
||||
\sa {Specify the environment for projects}, {Specifying Build Settings},
|
||||
*/
|
||||
@@ -39,7 +39,6 @@
|
||||
\li \l{Conan Build Configuration}
|
||||
\endlist
|
||||
\li \l{Specifying Run Settings}
|
||||
\li \l{Specifying Environment Settings}
|
||||
\li \l{Using Custom Output Parsers}
|
||||
\li \l{Sharing Project Settings}
|
||||
\endlist
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
To set preferences for opening files and handling open files, select
|
||||
\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
|
||||
\li In the \uicontrol {When files are externally modified} field,
|
||||
|
||||
@@ -1282,6 +1282,10 @@ protected:
|
||||
out(ast->rparenToken);
|
||||
if (ast->isArrowFunction && !ast->formals)
|
||||
out("()");
|
||||
if (ast->typeAnnotation) {
|
||||
out(": ");
|
||||
out(ast->typeAnnotation->type->toString());
|
||||
}
|
||||
out(" ");
|
||||
if (ast->isArrowFunction)
|
||||
out("=> ");
|
||||
@@ -1406,6 +1410,10 @@ protected:
|
||||
{
|
||||
for (FormalParameterList *it = ast; it; it = it->next) {
|
||||
accept(it->element);
|
||||
if (it->element->typeAnnotation) {
|
||||
out(": ");
|
||||
out(it->element->typeAnnotation->type->toString());
|
||||
}
|
||||
if (it->next)
|
||||
out(", ");
|
||||
}
|
||||
|
||||
@@ -2728,9 +2728,6 @@ TimeoutTaskAdapter::~TimeoutTaskAdapter()
|
||||
|
||||
void TimeoutTaskAdapter::start()
|
||||
{
|
||||
if (*task() == milliseconds::zero())
|
||||
QTimer::singleShot(0, this, [this] { emit done(true); });
|
||||
else
|
||||
m_timerId = scheduleTimeout(*task(), this, [this] { m_timerId = {}; emit done(true); });
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ public:
|
||||
bool m_enabled = true;
|
||||
bool m_readOnly = false;
|
||||
bool m_autoApply = true;
|
||||
bool m_hasEnabler = false;
|
||||
int m_spanX = 1;
|
||||
int m_spanY = 1;
|
||||
BaseAspect::ConfigWidgetCreator m_configWidgetCreator;
|
||||
@@ -347,6 +348,8 @@ void BaseAspect::setEnabler(BoolAspect *checker)
|
||||
{
|
||||
QTC_ASSERT(checker, return);
|
||||
|
||||
d->m_hasEnabler = true;
|
||||
|
||||
auto update = [this, checker] {
|
||||
BaseAspect::setEnabled(checker->isEnabled() && checker->volatileValue());
|
||||
};
|
||||
@@ -646,6 +649,10 @@ void BaseAspect::readSettings()
|
||||
if (settingsKey().isEmpty())
|
||||
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());
|
||||
setVariantValue(val.isValid() ? fromSettingsValue(val) : defaultVariantValue(), BeQuiet);
|
||||
}
|
||||
@@ -1794,8 +1801,6 @@ LayoutItem BoolAspect::adoptButton(QAbstractButton *button)
|
||||
*/
|
||||
void BoolAspect::addToLayout(Layouting::LayoutItem &parent)
|
||||
{
|
||||
QTC_ASSERT(m_buffer == m_internal, m_buffer = m_internal);
|
||||
|
||||
QCheckBox *checkBox = createSubWidget<QCheckBox>();
|
||||
addToLayoutHelper(parent, checkBox);
|
||||
bufferToGui();
|
||||
@@ -1903,7 +1908,6 @@ void SelectionAspect::addToLayout(Layouting::LayoutItem &parent)
|
||||
QTC_CHECK(d->m_buttonGroup == nullptr);
|
||||
QTC_CHECK(!d->m_comboBox);
|
||||
QTC_ASSERT(d->m_buttons.isEmpty(), d->m_buttons.clear());
|
||||
QTC_ASSERT(m_buffer == m_internal, m_buffer = m_internal);
|
||||
|
||||
switch (d->m_displayStyle) {
|
||||
case DisplayStyle::RadioButtons:
|
||||
|
||||
@@ -1256,7 +1256,8 @@ bool UnixDeviceFileAccess::iterateWithFind(const FilePath &filePath,
|
||||
|
||||
void UnixDeviceFileAccess::findUsingLs(const QString ¤t,
|
||||
const FileFilter &filter,
|
||||
QStringList *found) const
|
||||
QStringList *found,
|
||||
const QString &start) const
|
||||
{
|
||||
const RunResult result = runInShell(
|
||||
{"ls", {"-1", "-a", "-p", "--", current}, OsType::OsTypeLinux});
|
||||
@@ -1265,10 +1266,11 @@ void UnixDeviceFileAccess::findUsingLs(const QString ¤t,
|
||||
const QChar last = entry.back();
|
||||
if (last == '/') {
|
||||
entry.chop(1);
|
||||
if (filter.iteratorFlags.testFlag(QDirIterator::Subdirectories))
|
||||
findUsingLs(current + '/' + entry, filter, found);
|
||||
if (filter.iteratorFlags.testFlag(QDirIterator::Subdirectories) && entry != "."
|
||||
&& 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
|
||||
QStringList entries;
|
||||
findUsingLs(filePath.path(), filter, &entries);
|
||||
findUsingLs(filePath.path(), filter, &entries, {});
|
||||
iterateLsOutput(filePath, entries, filter, callBack);
|
||||
}
|
||||
|
||||
|
||||
@@ -183,16 +183,15 @@ protected:
|
||||
|
||||
expected_str<FilePath> createTempFile(const FilePath &filePath) override;
|
||||
|
||||
void findUsingLs(const QString ¤t,
|
||||
const FileFilter &filter,
|
||||
QStringList *found,
|
||||
const QString &start) const;
|
||||
|
||||
private:
|
||||
bool iterateWithFind(
|
||||
const FilePath &filePath,
|
||||
bool iterateWithFind(const FilePath &filePath,
|
||||
const FileFilter &filter,
|
||||
const FilePath::IterateDirCallback &callBack) const;
|
||||
void findUsingLs(
|
||||
const QString ¤t,
|
||||
const FileFilter &filter,
|
||||
QStringList *found) const;
|
||||
|
||||
QStringList statArgs(const FilePath &filePath,
|
||||
const QString &linuxFormat,
|
||||
|
||||
@@ -8,7 +8,11 @@
|
||||
#include "terminalcommand.h"
|
||||
#include "utilstr.h"
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QTemporaryFile>
|
||||
#include <QVersionNumber>
|
||||
|
||||
Q_LOGGING_CATEGORY(log, "terminal.externalprocess", QtWarningMsg)
|
||||
|
||||
namespace Utils {
|
||||
|
||||
@@ -17,21 +21,61 @@ ExternalTerminalProcessImpl::ExternalTerminalProcessImpl()
|
||||
setStubCreator(new ProcessStubCreator(this));
|
||||
}
|
||||
|
||||
ProcessStubCreator::ProcessStubCreator(TerminalInterface *interface)
|
||||
: m_interface(interface)
|
||||
{}
|
||||
|
||||
static const QLatin1String TerminalAppScriptAttached{R"(
|
||||
tell application "Terminal"
|
||||
QString ExternalTerminalProcessImpl::openTerminalScriptAttached()
|
||||
{
|
||||
static const QLatin1String script{R"(
|
||||
tell application "Terminal"
|
||||
activate
|
||||
set windowId to 0
|
||||
set newTab to do script "%1 && exit"
|
||||
set win to (the id of window 1 where its tab 1 = newTab) as text
|
||||
|
||||
-- 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
|
||||
close window id win
|
||||
end tell
|
||||
)"};
|
||||
|
||||
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)
|
||||
: m_interface(interface)
|
||||
{}
|
||||
|
||||
static const QLatin1String TerminalAppScriptDetached{R"(
|
||||
tell application "Terminal"
|
||||
@@ -52,8 +96,15 @@ expected_str<qint64> ProcessStubCreator::startStubProcess(const ProcessSetupData
|
||||
bool detached = setupData.m_terminalMode == TerminalMode::Detached;
|
||||
|
||||
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 = {
|
||||
{"Terminal.app", {TerminalAppScriptAttached, TerminalAppScriptDetached}},
|
||||
{"Terminal.app",
|
||||
{ExternalTerminalProcessImpl::openTerminalScriptAttached(), TerminalAppScriptDetached}},
|
||||
};
|
||||
|
||||
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()));
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -13,6 +13,8 @@ class QTCREATOR_UTILS_EXPORT ExternalTerminalProcessImpl final : public Terminal
|
||||
{
|
||||
public:
|
||||
ExternalTerminalProcessImpl();
|
||||
|
||||
static QString openTerminalScriptAttached();
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT ProcessStubCreator : public StubCreator
|
||||
|
||||
@@ -92,6 +92,7 @@ public:
|
||||
StubCreator *stubCreator{nullptr};
|
||||
|
||||
const bool waitOnExit;
|
||||
bool didInferiorRun{false};
|
||||
};
|
||||
|
||||
TerminalInterface::TerminalInterface(bool waitOnExit)
|
||||
@@ -156,6 +157,11 @@ void TerminalInterface::onStubExited()
|
||||
|
||||
if (d->inferiorProcessId)
|
||||
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()
|
||||
@@ -176,6 +182,7 @@ void TerminalInterface::onStubReadyRead()
|
||||
d->envListFile = nullptr;
|
||||
} else if (out.startsWith("pid ")) {
|
||||
d->inferiorProcessId = out.mid(4).toInt();
|
||||
d->didInferiorRun = true;
|
||||
emit started(d->inferiorProcessId, d->inferiorThreadId);
|
||||
} else if (out.startsWith("thread ")) { // Windows only
|
||||
d->inferiorThreadId = out.mid(7).toLongLong();
|
||||
@@ -349,7 +356,8 @@ void TerminalInterface::start()
|
||||
return;
|
||||
}
|
||||
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) {
|
||||
if (enabled)
|
||||
stream << key << '=' << value << '\0';
|
||||
});
|
||||
|
||||
|
||||
@@ -136,7 +136,6 @@ AutotestPluginPrivate::AutotestPluginPrivate()
|
||||
TestFrameworkManager::registerTestFramework(&theCatchFramework());
|
||||
|
||||
TestFrameworkManager::registerTestTool(&theCTestTool());
|
||||
TestFrameworkManager::synchronizeSettings();
|
||||
|
||||
m_resultsPane = TestResultsPane::instance();
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ BoostTestFramework::BoostTestFramework()
|
||||
seed.setLabelText(Tr::tr("Seed:"));
|
||||
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."));
|
||||
seed.setEnabler(&randomize);
|
||||
|
||||
randomize.setSettingsKey("Randomize");
|
||||
randomize.setLabelPlacement(BoolAspect::LabelPlacement::Compact);
|
||||
@@ -96,6 +95,10 @@ BoostTestFramework::BoostTestFramework()
|
||||
memLeaks.setDefaultValue(true);
|
||||
memLeaks.setLabelText(Tr::tr("Detect memory leaks"));
|
||||
memLeaks.setToolTip(Tr::tr("Enable memory leak detection."));
|
||||
|
||||
readSettings();
|
||||
|
||||
seed.setEnabler(&randomize);
|
||||
}
|
||||
|
||||
QString BoostTestFramework::logLevelToOption(const LogLevel logLevel)
|
||||
|
||||
@@ -49,29 +49,24 @@ CatchFramework::CatchFramework()
|
||||
|
||||
abortAfter.setSettingsKey("AbortAfter");
|
||||
abortAfter.setRange(1, 9999);
|
||||
abortAfter.setEnabler(&abortAfterChecked);
|
||||
|
||||
benchmarkSamples.setSettingsKey("BenchSamples");
|
||||
benchmarkSamples.setRange(1, 999999);
|
||||
benchmarkSamples.setDefaultValue(100);
|
||||
benchmarkSamples.setEnabler(&samplesChecked);
|
||||
|
||||
benchmarkResamples.setSettingsKey("BenchResamples");
|
||||
benchmarkResamples.setRange(1, 9999999);
|
||||
benchmarkResamples.setDefaultValue(100000);
|
||||
benchmarkResamples.setToolTip(Tr::tr("Number of resamples for bootstrapping."));
|
||||
benchmarkResamples.setEnabler(&resamplesChecked);
|
||||
|
||||
confidenceInterval.setSettingsKey("BenchConfInt");
|
||||
confidenceInterval.setRange(0., 1.);
|
||||
confidenceInterval.setSingleStep(0.05);
|
||||
confidenceInterval.setDefaultValue(0.95);
|
||||
confidenceInterval.setEnabler(&confidenceIntervalChecked);
|
||||
|
||||
benchmarkWarmupTime.setSettingsKey("BenchWarmup");
|
||||
benchmarkWarmupTime.setSuffix(Tr::tr(" ms"));
|
||||
benchmarkWarmupTime.setRange(0, 10000);
|
||||
benchmarkWarmupTime.setEnabler(&warmupChecked);
|
||||
|
||||
abortAfterChecked.setSettingsKey("AbortChecked");
|
||||
abortAfterChecked.setLabelText(Tr::tr("Abort after"));
|
||||
@@ -117,6 +112,14 @@ CatchFramework::CatchFramework()
|
||||
warnOnEmpty.setSettingsKey("WarnEmpty");
|
||||
warnOnEmpty.setLabelText(Tr::tr("Warn on empty tests"));
|
||||
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()
|
||||
|
||||
@@ -108,6 +108,9 @@ CTestTool::CTestTool()
|
||||
threshold.setLabelText(Tr::tr("Threshold"));
|
||||
threshold.setDefaultValue(1);
|
||||
threshold.setRange(1, 128);
|
||||
|
||||
readSettings();
|
||||
|
||||
threshold.setEnabler(&testLoad);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ GTestFramework::GTestFramework()
|
||||
iterations.setDefaultValue(1);
|
||||
iterations.setEnabled(false);
|
||||
iterations.setLabelText(Tr::tr("Iterations:"));
|
||||
iterations.setEnabler(&repeat);
|
||||
|
||||
seed.setSettingsKey("Seed");
|
||||
seed.setSpecialValueText({});
|
||||
@@ -60,7 +59,6 @@ GTestFramework::GTestFramework()
|
||||
seed.setEnabled(false);
|
||||
seed.setLabelText(Tr::tr("Seed:"));
|
||||
seed.setToolTip(Tr::tr("A seed of 0 generates a seed based on the current timestamp."));
|
||||
seed.setEnabler(&shuffle);
|
||||
|
||||
runDisabled.setSettingsKey("RunDisabled");
|
||||
runDisabled.setLabelText(Tr::tr("Run disabled tests"));
|
||||
@@ -132,6 +130,11 @@ GTestFramework::GTestFramework()
|
||||
connect(this, &AspectContainer::applied, this, [] {
|
||||
TestTreeModel::instance()->rebuild({GTest::Constants::FRAMEWORK_ID});
|
||||
});
|
||||
|
||||
readSettings();
|
||||
|
||||
seed.setEnabler(&shuffle);
|
||||
iterations.setEnabler(&repeat);
|
||||
}
|
||||
|
||||
ITestParser *GTestFramework::createTestParser()
|
||||
|
||||
@@ -92,7 +92,6 @@ QtTestFramework::QtTestFramework()
|
||||
maxWarnings.setRange(0, 10000);
|
||||
maxWarnings.setDefaultValue(2000);
|
||||
maxWarnings.setSpecialValueText(Tr::tr("Unlimited"));
|
||||
maxWarnings.setEnabler(&limitWarnings);
|
||||
|
||||
quickCheckForDerivedTests.setSettingsKey("QuickCheckForDerivedTests");
|
||||
quickCheckForDerivedTests.setDefaultValue(false);
|
||||
@@ -100,6 +99,10 @@ QtTestFramework::QtTestFramework()
|
||||
quickCheckForDerivedTests.setToolTip(
|
||||
Tr::tr("Search for Qt Quick tests that are derived from TestCase.\nWarning: Enabling this "
|
||||
"feature significantly increases scan time."));
|
||||
|
||||
readSettings();
|
||||
|
||||
maxWarnings.setEnabler(&limitWarnings);
|
||||
}
|
||||
|
||||
QString QtTestFramework::metricsTypeToOption(const MetricsType type)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace Autotest::TestFrameworkManager {
|
||||
|
||||
void registerTestFramework(ITestFramework *framework);
|
||||
void registerTestTool(ITestTool *testTool);
|
||||
void synchronizeSettings();
|
||||
|
||||
ITestFramework *frameworkForId(Utils::Id frameworkId);
|
||||
ITestTool *testToolForId(Utils::Id testToolId);
|
||||
|
||||
@@ -64,7 +64,6 @@ TestSettings::TestSettings()
|
||||
resultDescriptionMaxSize.setSettingsKey("ResultDescriptionMaxSize");
|
||||
resultDescriptionMaxSize.setDefaultValue(10);
|
||||
resultDescriptionMaxSize.setRange(1, 100000);
|
||||
resultDescriptionMaxSize.setEnabler(&limitResultDescription);
|
||||
|
||||
autoScroll.setSettingsKey("AutoScrollResults");
|
||||
autoScroll.setDefaultValue(true);
|
||||
@@ -95,7 +94,6 @@ TestSettings::TestSettings()
|
||||
|
||||
popupOnFail.setSettingsKey("PopupOnFail");
|
||||
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 "
|
||||
"failed, fatal or unexpectedly passed tests."));
|
||||
|
||||
@@ -105,6 +103,11 @@ TestSettings::TestSettings()
|
||||
runAfterBuild.addOption(Tr::tr("None"));
|
||||
runAfterBuild.addOption(Tr::tr("All"));
|
||||
runAfterBuild.addOption(Tr::tr("Selected"));
|
||||
|
||||
fromSettings();
|
||||
|
||||
resultDescriptionMaxSize.setEnabler(&limitResultDescription);
|
||||
popupOnFail.setEnabler(&popupOnFinish);
|
||||
}
|
||||
|
||||
void TestSettings::toSettings() const
|
||||
|
||||
@@ -124,31 +124,7 @@ public:
|
||||
&& prj->hasMakeInstallEquivalent();
|
||||
});
|
||||
addInitialStep(Qdb::Constants::QdbStopApplicationStepId);
|
||||
addInitialStep(RemoteLinux::Constants::GenericDeployStepId, [](Target *target) {
|
||||
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;
|
||||
});
|
||||
addInitialStep(RemoteLinux::Constants::GenericDeployStepId);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <cppeditor/clangdiagnosticconfigsmodel.h>
|
||||
#include <cppeditor/cppprojectfile.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
@@ -76,14 +77,17 @@ static QStringList checksArguments(const AnalyzeInputData &input)
|
||||
return {};
|
||||
}
|
||||
|
||||
static QStringList clangArguments(const ClangDiagnosticConfig &diagnosticConfig,
|
||||
const QStringList &baseOptions)
|
||||
static QStringList clangArguments(const AnalyzeInputData &input)
|
||||
{
|
||||
QStringList arguments;
|
||||
const ClangDiagnosticConfig &diagnosticConfig = input.config;
|
||||
const QStringList &baseOptions = input.unit.arguments;
|
||||
arguments << ClangDiagnosticConfigsModel::globalDiagnosticOptions()
|
||||
<< (isClMode(baseOptions) ? clangArgsForCl(diagnosticConfig.clangOptions())
|
||||
: diagnosticConfig.clangOptions())
|
||||
<< baseOptions;
|
||||
if (ProjectFile::isHeader(input.unit.file))
|
||||
arguments << "-Wno-pragma-once-outside-header";
|
||||
|
||||
if (LOG().isDebugEnabled())
|
||||
arguments << QLatin1String("-v");
|
||||
@@ -157,7 +161,7 @@ GroupItem clangToolTask(const AnalyzeInputData &input,
|
||||
const QStringList args = checksArguments(input)
|
||||
+ mainToolArguments(data)
|
||||
+ QStringList{"--"}
|
||||
+ clangArguments(input.config, input.unit.arguments);
|
||||
+ clangArguments(input);
|
||||
const CommandLine commandLine = {data.executable, args};
|
||||
|
||||
qCDebug(LOG).noquote() << "Starting" << commandLine.toUserOutput();
|
||||
|
||||
@@ -777,6 +777,9 @@ void CMakeBuildStep::updateDeploymentData()
|
||||
|
||||
IDeviceConstPtr runDevice = DeviceKitAspect::device(buildSystem()->kit());
|
||||
|
||||
if (!runDevice)
|
||||
return;
|
||||
|
||||
const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(),
|
||||
[](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); });
|
||||
|
||||
|
||||
@@ -1004,6 +1004,30 @@ void CMakeBuildSystem::updateProjectData()
|
||||
QtSupport::CppKitInfo kitInfo(kit());
|
||||
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;
|
||||
RawProjectParts rpps = m_reader.createRawProjectParts(errorMessage);
|
||||
if (!errorMessage.isEmpty())
|
||||
@@ -1011,8 +1035,7 @@ void CMakeBuildSystem::updateProjectData()
|
||||
qCDebug(cmakeBuildSystemLog) << "Raw project parts created." << errorMessage;
|
||||
|
||||
for (RawProjectPart &rpp : rpps) {
|
||||
rpp.setQtVersion(
|
||||
kitInfo.projectPartQtVersion); // TODO: Check if project actually uses Qt.
|
||||
rpp.setQtVersion(qtVersion); // TODO: Check if project actually uses Qt.
|
||||
const FilePath includeFileBaseDir = buildConfiguration()->buildDirectory();
|
||||
QStringList cxxFlags = rpp.flagsForCxx.commandLineFlags;
|
||||
QStringList cFlags = rpp.flagsForC.commandLineFlags;
|
||||
@@ -1769,7 +1792,7 @@ void CMakeBuildSystem::updateQmlJSCodeModel(const QStringList &extraHeaderPaths,
|
||||
auto addImports = [&projectInfo](const QString &imports) {
|
||||
const QStringList importList = CMakeConfigItem::cmakeSplitValue(imports);
|
||||
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();
|
||||
|
||||
@@ -116,7 +116,9 @@ static Environment getEnvCombined(const std::optional<Environment> &optPresetEnv
|
||||
Environment result = env;
|
||||
|
||||
if (optPresetEnv) {
|
||||
optPresetEnv->forEachEntry([&result](const QString &key, const QString &value, bool) {
|
||||
optPresetEnv->forEachEntry([&result](const QString &key, const QString &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)
|
||||
{
|
||||
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_;
|
||||
expandAllButEnv(preset, sourceDirectory, value);
|
||||
value = expandMacroEnv("env", value, [presetEnv](const QString ¯oName) {
|
||||
@@ -163,7 +167,9 @@ template<class PresetType>
|
||||
void expand(const PresetType &preset, EnvironmentItems &envItems, const FilePath &sourceDirectory)
|
||||
{
|
||||
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_;
|
||||
expandAllButEnv(preset, sourceDirectory, value);
|
||||
value = expandMacroEnv("env", value, [presetEnv](const QString ¯oName) {
|
||||
|
||||
@@ -209,14 +209,17 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se
|
||||
|
||||
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,
|
||||
this,
|
||||
&SourceEditorWidget::sourceCodeChanged);
|
||||
|
||||
m_codeEditor->setTextDocument(document);
|
||||
m_codeEditor->setTextDocument(sourceTextDocument);
|
||||
m_codeEditor->updateHighlighter();
|
||||
|
||||
auto addCompilerButton = new QToolButton;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
|
||||
namespace CompilerExplorer {
|
||||
@@ -58,6 +60,12 @@ public:
|
||||
|
||||
ApiConfigFunction apiConfigFunction() const { return m_apiConfigFunction; }
|
||||
|
||||
TextEditor::TextDocumentPtr sourceTextDocument() const { return m_sourceTextDocument; }
|
||||
void setSourceTextDocument(TextEditor::TextDocumentPtr sourceTextDocument)
|
||||
{
|
||||
m_sourceTextDocument = sourceTextDocument;
|
||||
}
|
||||
|
||||
public:
|
||||
Utils::StringSelectionAspect languageId{this};
|
||||
Utils::StringAspect source{this};
|
||||
@@ -75,6 +83,7 @@ private:
|
||||
private:
|
||||
CompilerExplorerSettings *m_parent;
|
||||
ApiConfigFunction m_apiConfigFunction;
|
||||
TextEditor::TextDocumentPtr m_sourceTextDocument{nullptr};
|
||||
};
|
||||
|
||||
class CompilerSettings : public Utils::AspectContainer,
|
||||
|
||||
@@ -85,7 +85,6 @@ SystemSettings::SystemSettings()
|
||||
autoSaveInterval.setSuffix(Tr::tr("min"));
|
||||
autoSaveInterval.setRange(1, 1000000);
|
||||
autoSaveInterval.setDefaultValue(5);
|
||||
autoSaveInterval.setEnabler(&autoSaveModifiedFiles);
|
||||
autoSaveInterval.setLabelText(Tr::tr("Interval:"));
|
||||
|
||||
autoSaveAfterRefactoring.setSettingsKey("EditorManager/AutoSaveAfterRefactoring");
|
||||
@@ -107,7 +106,6 @@ SystemSettings::SystemSettings()
|
||||
autoSuspendMinDocumentCount.setSettingsKey("EditorManager/AutoSuspendMinDocuments");
|
||||
autoSuspendMinDocumentCount.setRange(1, 500);
|
||||
autoSuspendMinDocumentCount.setDefaultValue(30);
|
||||
autoSuspendMinDocumentCount.setEnabler(&autoSuspendEnabled);
|
||||
autoSuspendMinDocumentCount.setLabelText(Tr::tr("Files to keep open:"));
|
||||
autoSuspendMinDocumentCount.setToolTip(
|
||||
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.setRange(1, 500);
|
||||
bigFileSizeLimitInMB.setDefaultValue(5);
|
||||
bigFileSizeLimitInMB.setEnabler(&warnBeforeOpeningBigFiles);
|
||||
|
||||
maxRecentFiles.setSettingsKey("EditorManager/MaxRecentFiles");
|
||||
maxRecentFiles.setRange(1, 99);
|
||||
@@ -151,6 +148,11 @@ SystemSettings::SystemSettings()
|
||||
showCrashButton.setSettingsKey("ShowCrashButton");
|
||||
#endif
|
||||
readSettings();
|
||||
|
||||
autoSaveInterval.setEnabler(&autoSaveModifiedFiles);
|
||||
autoSuspendMinDocumentCount.setEnabler(&autoSuspendEnabled);
|
||||
bigFileSizeLimitInMB.setEnabler(&warnBeforeOpeningBigFiles);
|
||||
|
||||
connect(&autoSaveModifiedFiles, &BaseAspect::changed,
|
||||
this, &EditorManagerPrivate::updateAutoSave);
|
||||
connect(&autoSaveInterval, &BaseAspect::changed, this, &EditorManagerPrivate::updateAutoSave);
|
||||
|
||||
@@ -1647,8 +1647,8 @@ QList<ProjectPart::ConstPtr> CppModelManager::projectPart(const FilePath &fileNa
|
||||
{
|
||||
{
|
||||
QReadLocker locker(&d->m_projectLock);
|
||||
auto it = d->m_fileToProjectParts.find(fileName);
|
||||
if (it != d->m_fileToProjectParts.end())
|
||||
auto it = d->m_fileToProjectParts.constFind(fileName);
|
||||
if (it != d->m_fileToProjectParts.constEnd())
|
||||
return it.value();
|
||||
}
|
||||
const FilePath canonicalPath = fileName.canonicalPath();
|
||||
|
||||
@@ -58,10 +58,13 @@ void DapClient::sendInitialize()
|
||||
postRequest("initialize", QJsonObject{{"clientID", "QtCreator"}, {"clientName", "QtCreator"}});
|
||||
}
|
||||
|
||||
void DapClient::sendLaunch(const Utils::FilePath &executable)
|
||||
void DapClient::sendLaunch(const Utils::CommandLine &command)
|
||||
{
|
||||
postRequest("launch",
|
||||
QJsonObject{{"noDebug", false}, {"program", executable.path()}, {"__restart", ""}});
|
||||
QJsonObject{{"noDebug", false},
|
||||
{"program", command.executable().path()},
|
||||
{"args", command.arguments()},
|
||||
{"__restart", ""}});
|
||||
}
|
||||
|
||||
void DapClient::sendAttach()
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
|
||||
virtual void sendInitialize();
|
||||
|
||||
void sendLaunch(const Utils::FilePath &executable);
|
||||
void sendLaunch(const Utils::CommandLine &command);
|
||||
void sendAttach();
|
||||
void sendConfigurationDone();
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ void DapEngine::handleDapInitialize()
|
||||
{
|
||||
QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state());
|
||||
|
||||
m_dapClient->sendLaunch(runParameters().inferior.command.executable());
|
||||
m_dapClient->sendLaunch(runParameters().inferior.command);
|
||||
|
||||
qCDebug(logCategory()) << "handleDapLaunch";
|
||||
}
|
||||
@@ -523,6 +523,9 @@ QString DapEngine::errorMessage(QProcess::ProcessError error) const
|
||||
|
||||
void DapEngine::handleDapDone()
|
||||
{
|
||||
if (state() == DebuggerFinished)
|
||||
return;
|
||||
|
||||
if (m_dapClient->dataProvider()->result() == ProcessResult::StartFailed) {
|
||||
notifyEngineSetupFailed();
|
||||
showMessage("ADAPTER START FAILED");
|
||||
@@ -812,7 +815,7 @@ void DapEngine::refreshLocals(const QJsonArray &variables)
|
||||
if (currentItem && currentItem->iname.startsWith("watch"))
|
||||
currentItem->removeChildren();
|
||||
|
||||
for (auto variable : variables) {
|
||||
for (const auto &variable : variables) {
|
||||
WatchItem *item = new WatchItem;
|
||||
const QString name = variable.toObject().value("name").toString();
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ public:
|
||||
void start() override
|
||||
{
|
||||
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.setCommand(m_cmd);
|
||||
m_proc.start();
|
||||
|
||||
@@ -662,9 +662,11 @@ CommandLine DockerDevicePrivate::withDockerExecCmd(const CommandLine &cmd,
|
||||
dockerCmd.addArg("-t");
|
||||
|
||||
if (env) {
|
||||
env->forEachEntry([&](const QString &key, const QString &value, bool) {
|
||||
env->forEachEntry([&](const QString &key, const QString &value, bool enabled) {
|
||||
if (enabled) {
|
||||
dockerCmd.addArg("-e");
|
||||
dockerCmd.addArg(key + "=" + env->expandVariables(value));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -156,8 +156,6 @@ FakeVimSettings::FakeVimSettings()
|
||||
|
||||
Row ints { shiftWidth, tabStop, scrollOff, st };
|
||||
|
||||
vimRcPath.setEnabler(&readVimRc);
|
||||
|
||||
Column strings {
|
||||
backspace,
|
||||
isKeyword,
|
||||
@@ -239,6 +237,8 @@ FakeVimSettings::FakeVimSettings()
|
||||
|
||||
readSettings();
|
||||
|
||||
vimRcPath.setEnabler(&readVimRc);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -592,6 +592,11 @@ bool Client::reachable() const
|
||||
return d->m_state == Initialized;
|
||||
}
|
||||
|
||||
void Client::resetRestartCounter()
|
||||
{
|
||||
d->m_restartsLeft = ClientPrivate::MaxRestarts;
|
||||
}
|
||||
|
||||
void Client::setClientInfo(const LanguageServerProtocol::ClientInfo &clientInfo)
|
||||
{
|
||||
d->m_clientInfo = clientInfo;
|
||||
|
||||
@@ -86,6 +86,7 @@ public:
|
||||
State state() const;
|
||||
QString stateString() const;
|
||||
bool reachable() const;
|
||||
void resetRestartCounter();
|
||||
|
||||
void setClientInfo(const LanguageServerProtocol::ClientInfo &clientInfo);
|
||||
// capabilities
|
||||
|
||||
@@ -159,6 +159,7 @@ void LanguageClientManager::clientFinished(Client *client)
|
||||
QTC_ASSERT(managerInstance, return);
|
||||
|
||||
if (managerInstance->m_restartingClients.remove(client)) {
|
||||
client->resetRestartCounter();
|
||||
client->reset();
|
||||
client->start();
|
||||
return;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
@@ -22,7 +23,8 @@ class HeaderPath
|
||||
{
|
||||
public:
|
||||
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 Utils::FilePath &path, HeaderPathType type)
|
||||
: HeaderPath(path.path(), type)
|
||||
|
||||
@@ -867,7 +867,8 @@ QtSupport::ProFileReader *QmakeBuildSystem::createProFileReader(const QmakeProFi
|
||||
rootProFileName,
|
||||
deviceRoot());
|
||||
|
||||
env.forEachEntry([&](const QString &key, const QString &value, bool) {
|
||||
env.forEachEntry([&](const QString &key, const QString &value, bool enabled) {
|
||||
if (enabled)
|
||||
m_qmakeGlobals->environment.insert(key, env.expandVariables(value));
|
||||
});
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ QmlProfilerSettings::QmlProfilerSettings()
|
||||
flushInterval.setRange(1, 10000000);
|
||||
flushInterval.setDefaultValue(1000);
|
||||
flushInterval.setLabelText(Tr::tr("Flush interval (ms):"));
|
||||
flushInterval.setEnabler(&flushEnabled);
|
||||
|
||||
lastTraceFile.setSettingsKey("Analyzer.QmlProfiler.LastTraceFile");
|
||||
|
||||
@@ -63,6 +62,8 @@ QmlProfilerSettings::QmlProfilerSettings()
|
||||
});
|
||||
|
||||
readSettings();
|
||||
|
||||
flushInterval.setEnabler(&flushEnabled);
|
||||
}
|
||||
|
||||
// QmlProfilerSettingsPage
|
||||
|
||||
@@ -41,7 +41,6 @@ CodeGenSettings::CodeGenSettings()
|
||||
|
||||
addQtVersionCheck.setSettingsKey("AddQtVersionCheck");
|
||||
addQtVersionCheck.setLabelText(Tr::tr("Add Qt version #ifdef for module names"));
|
||||
addQtVersionCheck.setEnabler(&includeQtModule);
|
||||
|
||||
setLayouter([this] {
|
||||
using namespace Layouting;
|
||||
@@ -66,6 +65,7 @@ CodeGenSettings::CodeGenSettings()
|
||||
|
||||
|
||||
readSettings();
|
||||
addQtVersionCheck.setEnabler(&includeQtModule);
|
||||
}
|
||||
|
||||
class CodeGenSettingsPage final : public Core::IOptionsPage
|
||||
|
||||
@@ -768,7 +768,8 @@ CommandLine SshProcessInterfacePrivate::fullLocalCommandLine() const
|
||||
inner.addArgs(QString("echo ") + s_pidMarker + "$$" + s_pidMarker + " && ", CommandLine::Raw);
|
||||
|
||||
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) {
|
||||
if (enabled)
|
||||
inner.addArgs(key + "='" + env.expandVariables(value) + '\'', CommandLine::Raw);
|
||||
});
|
||||
|
||||
|
||||
@@ -113,7 +113,6 @@ ScreenRecorderSettings::ScreenRecorderSettings()
|
||||
fileSizeLimit.setDefaultValue(1024);
|
||||
fileSizeLimit.setRange(100, 1024 * 1024 * 2); // Up to 2GB
|
||||
fileSizeLimit.setSuffix("MB");
|
||||
fileSizeLimit.setEnabler(&enableFileSizeLimit);
|
||||
|
||||
enableRtBuffer.setSettingsKey("EnableRealTimeBuffer");
|
||||
enableRtBuffer.setDefaultValue(true);
|
||||
@@ -124,7 +123,6 @@ ScreenRecorderSettings::ScreenRecorderSettings()
|
||||
rtBufferSize.setDefaultValue(1024);
|
||||
rtBufferSize.setRange(100, 1024 * 1024 * 2); // Up to 2GB
|
||||
rtBufferSize.setSuffix("MB");
|
||||
rtBufferSize.setEnabler(&enableRtBuffer);
|
||||
|
||||
logFfmpegCommandline.setSettingsKey("LogFFMpegCommandLine");
|
||||
logFfmpegCommandline.setDefaultValue(false);
|
||||
@@ -206,6 +204,9 @@ ScreenRecorderSettings::ScreenRecorderSettings()
|
||||
|
||||
readSettings();
|
||||
|
||||
rtBufferSize.setEnabler(&enableRtBuffer);
|
||||
fileSizeLimit.setEnabler(&enableFileSizeLimit);
|
||||
|
||||
setCaptureMouseClicksVisible();
|
||||
connect(&screenCaptureType, &SelectionAspect::volatileValueChanged, this,
|
||||
setCaptureMouseClicksVisible);
|
||||
|
||||
@@ -103,7 +103,6 @@ add_qtc_plugin(TextEditor
|
||||
texteditor.qrc
|
||||
texteditor_global.h
|
||||
texteditortr.h
|
||||
texteditor_p.h
|
||||
texteditoractionhandler.cpp texteditoractionhandler.h
|
||||
texteditorconstants.cpp texteditorconstants.h
|
||||
texteditoroverlay.cpp texteditoroverlay.h
|
||||
|
||||
@@ -120,8 +120,10 @@ OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) :
|
||||
m_toggleSort->setToolTip(Tr::tr("Sort Alphabetically"));
|
||||
connect(m_toggleSort, &QAbstractButton::clicked, this, &OutlineWidgetStack::toggleSort);
|
||||
|
||||
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
|
||||
this, &OutlineWidgetStack::updateEditor);
|
||||
connect(Core::EditorManager::instance(),
|
||||
&Core::EditorManager::currentEditorChanged,
|
||||
this,
|
||||
&OutlineWidgetStack::updateCurrentEditor);
|
||||
connect(factory, &OutlineFactory::updateOutline,
|
||||
this, &OutlineWidgetStack::updateCurrentEditor);
|
||||
updateCurrentEditor();
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "tabsettings.h"
|
||||
#include "textdocument.h"
|
||||
#include "textdocumentlayout.h"
|
||||
#include "texteditor_p.h"
|
||||
#include "texteditoractionhandler.h"
|
||||
#include "texteditorconstants.h"
|
||||
#include "texteditoroverlay.h"
|
||||
@@ -563,6 +562,19 @@ struct PaintEventBlockData
|
||||
|
||||
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
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -134,7 +134,6 @@ QtcPlugin {
|
||||
"texteditor.h",
|
||||
"texteditor.qrc",
|
||||
"texteditor_global.h", "texteditortr.h",
|
||||
"texteditor_p.h",
|
||||
"texteditoractionhandler.cpp",
|
||||
"texteditoractionhandler.h",
|
||||
"texteditorconstants.cpp",
|
||||
|
||||
@@ -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
|
||||
@@ -28,6 +28,11 @@ public:
|
||||
private slots:
|
||||
void test();
|
||||
void test_data();
|
||||
|
||||
void reformatter_data();
|
||||
void reformatter();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
tst_Reformatter::tst_Reformatter()
|
||||
@@ -41,9 +46,17 @@ void tst_Reformatter::test_data()
|
||||
{
|
||||
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);
|
||||
while (it.hasNext()) {
|
||||
const QString fileName = it.next();
|
||||
if (!excludedFiles.contains(fileName))
|
||||
QTest::newRow(fileName.toLatin1()) << it.filePath();
|
||||
}
|
||||
}
|
||||
@@ -84,6 +97,44 @@ void tst_Reformatter::test()
|
||||
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);
|
||||
|
||||
#include "tst_reformatter.moc"
|
||||
|
||||
18
tests/auto/qml/reformatter/typeAnnotations.formatted.qml
Normal 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
|
||||
}
|
||||
}
|
||||
17
tests/auto/qml/reformatter/typeAnnotations.qml
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,11 @@ public:
|
||||
p.waitForFinished();
|
||||
return {p.exitCode(), p.readAllStandardOutput(), p.readAllStandardError()};
|
||||
}
|
||||
|
||||
void findUsingLs(const QString ¤t, const FileFilter &filter, QStringList *found)
|
||||
{
|
||||
UnixDeviceFileAccess::findUsingLs(current, filter, found, {});
|
||||
}
|
||||
};
|
||||
|
||||
class tst_unixdevicefileaccess : public QObject
|
||||
@@ -69,6 +74,27 @@ private slots:
|
||||
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:
|
||||
TestDFA m_dfa;
|
||||
DeviceFileAccess *m_dfaPtr = &m_dfa;
|
||||
|
||||
@@ -12,6 +12,7 @@ add_subdirectory(fakevim)
|
||||
# add_subdirectory(genericproject)
|
||||
add_subdirectory(pluginview)
|
||||
add_subdirectory(proparser)
|
||||
add_subdirectory(terminal)
|
||||
# add_subdirectory(qml)
|
||||
# add_subdirectory(qt4projectmanager)
|
||||
# add_subdirectory(search)
|
||||
|
||||