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

This commit is contained in:
The Qt Project
2023-06-22 14:51:12 +00:00
466 changed files with 5238 additions and 5077 deletions

View File

@@ -62,9 +62,11 @@ jobs:
execute_process(COMMAND git submodule set-url -- perfparser https://code.qt.io/qt-creator/perfparser.git)
execute_process(COMMAND git submodule update --init --recursive)
file(MAKE_DIRECTORY release)
if (${{github.ref}} MATCHES "tags/v(.*)")
if (${{github.ref}} MATCHES "tags/v([0-9.]+)")
file(APPEND "$ENV{GITHUB_OUTPUT}" "tag=${CMAKE_MATCH_1}\n")
file(READ "dist/changelog/changes-${CMAKE_MATCH_1}.md" changelog_md)
if (EXISTS "dist/changelog/changes-${CMAKE_MATCH_1}.md")
file(READ "dist/changelog/changes-${CMAKE_MATCH_1}.md" changelog_md)
endif()
file(WRITE "release/changelog.md" "These packages are not officially supported, for official packages please check out https://download.qt.io/official_releases/qtcreator\n\n")
file(APPEND "release/changelog.md" "${changelog_md}")
else()

View File

@@ -1,6 +1,6 @@
set(IDE_VERSION "10.0.82") # The IDE version.
set(IDE_VERSION_COMPAT "10.0.82") # The IDE Compatibility version.
set(IDE_VERSION_DISPLAY "11.0.0-beta1") # The IDE display version.
set(IDE_VERSION "10.0.84") # The IDE version.
set(IDE_VERSION_COMPAT "10.0.84") # The IDE Compatibility version.
set(IDE_VERSION_DISPLAY "11.0.0-rc1") # The IDE display version.
set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year.
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.

View File

@@ -30,7 +30,19 @@ function(_extract_ts_data_from_targets outprefix)
set(_target_sources "")
if(_source_files)
list(FILTER _source_files EXCLUDE REGEX ".*[.]json[.]in|.*[.]svg|.*[.]pro|.*[.]css")
# exclude various funny source files, and anything generated
# like *metatypes.json.gen, moc_*.cpp, qrc_*.cpp, */qmlcache/*.cpp,
# *qmltyperegistrations.cpp
string(REGEX REPLACE "(\\^|\\$|\\.|\\[|\\]|\\*|\\+|\\?|\\(|\\)|\\|)" "\\\\\\1" binary_dir_regex "${PROJECT_BINARY_DIR}")
set(_exclude_patterns
.*[.]json[.]in
.*[.]svg
.*[.]pro
.*[.]css
"${binary_dir_regex}/.*"
)
list(JOIN _exclude_patterns "|" _exclude_pattern)
list(FILTER _source_files EXCLUDE REGEX "${_exclude_pattern}")
list(APPEND _target_sources ${_source_files})
endif()
if(_extra_translations)

76
dist/changelog/changes-10.0.2.md vendored Normal file
View File

@@ -0,0 +1,76 @@
Qt Creator 10.0.2
=================
Qt Creator version 10.0.2 contains bug fixes.
The most important changes are listed in this document. For a complete list of
changes, see the Git log for the Qt Creator sources that you can check out from
the public Git repository. For example:
git clone git://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline origin/v10.0.1..v10.0.2
General
-------
* Fixed freezes due to excessive file watching (QTCREATORBUG-28957)
Editing
-------
### C++
* Fixed a crash when following symbols (QTCREATORBUG-28989)
* Fixed the highlighting of raw string literals with empty lines
(QTCREATORBUG-29200)
* Clang Format
* Fixed the editing of custom code styles (QTCREATORBUG-29129)
* Fixed that the wrong code style could be used (QTCREATORBUG-29145)
Projects
--------
* Fixed a crash when triggering a build with unconfigured projects present
(QTCREATORBUG-29207)
### CMake
* Fixed that the global `Autorun CMake` option could be overridden by old
settings
* Fixed the `Build CMake Target` locator filter in case a build is already
running (QTCREATORBUG-26699)
* Presets
* Added the expansion of `${hostSystemName}` (QTCREATORBUG-28935)
* Fixed the Qt detection when `CMAKE_TOOLCHAIN_FILE` and `CMAKE_PREFIX_PATH`
are set
Debugging
---------
* Fixed that debugger tooltips in the editor vanished after expanding
(QTCREATORBUG-29083)
Test Integration
----------------
* GoogleTest
* Fixed the reporting of failed tests (QTCREATORBUG-29146)
Credits for these changes go to:
--------------------------------
Alessandro Portale
André Pönitz
Artem Sokolovskii
Björn Schäpers
Christian Kandeler
Christian Stenger
Cristian Adam
David Schulz
Eike Ziller
Jaroslaw Kobus
Karim Abdelrahman
Leena Miettinen
Miikka Heikkinen
Patrik Teivonen
Robert Löhning
Sivert Krøvel

View File

@@ -10,21 +10,85 @@ the public Git repository. For example:
git clone git://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline origin/10.0..v11.0.0
What's new?
------------
* Markdown editor with preview
([QTCREATORBUG-27883](https://bugreports.qt.io/browse/QTCREATORBUG-27883))
* Internal terminal
([QTCREATORBUG-8511](https://bugreports.qt.io/browse/QTCREATORBUG-8511))
* Experimental support for GitHub Copilot
* Experimental support for the `vcpkg` C/C++ package manager
* Experimental support for the Axivion static analyzer
### Markdown
You can open markdown (.md) files for editing or select `File > New File >
General > Markdown File` to create a new file.
([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-markdown-editor.html))
### Terminal
When you select the `Run in Terminal` check box and run an application or the
`Open Terminal` button to open a terminal, the default terminal opens in the
`Terminal` output view. It supports multiple tabs, as well as various
shells, colors, and fonts.
To use an external terminal, deselect the `Use internal terminal` check box in
`Preferences > Terminal`.
([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-output-panes.html#terminal))
### Copilot
The Copilot plugin (disabled by default) integrates
[GitHub Copilot](https://github.com/features/copilot), which uses OpenAI to
suggest code in the `Edit` mode.
To set Copilot preferences, select `Preferences > Copilot`.
([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-copilot.html))
### vcpkg
The experimental vcpkg plugin integrates the [vcpgk](https://vcpkg.io)
package manager for downloading and managing libraries.
Select the `vcpkg` installation location in `Preferences > CMake > Vcpkg > Path`.
To create a new `vcpkg.json` package manifest file, select `File > New File >
vcpkg`. The file is automatically added to the CMakeLists.txt file for the
project.
Edit manifest files in the manifest editor. To search for packages to add to the
file, select the `Search Package` button on the manifest editor toolbar.
([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-vcpkg.html))
### Axivion
After you configure access to the [Axivion](https://www.axivion.com) Dashboard
and link a project to an Axivion project in the project settings, Qt Creator
shows annotations of the latest run in the editors and allows you to view some
details on the issues.
([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-axivion.html))
General
-------
* Added a `Terminal` view (QTCREATORBUG-8511)
([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-output-panes.html#terminal))
* Opt-out via `Preferences` > `Terminal` preferences
* Added support for
* different shells, colors, fonts, and multiple tabs
* opening file paths in Qt Creator with `Ctrl+click` (`Cmd+click` on
macOS)
* Added a more spacious "relaxed" toolbar style `Environment > Interface`
* Added a more spacious `Relaxed` toolbar style to `Preferences > Environment >
Interface`
* Added a pin button to progress details instead of automatically resetting
their position (QTCREATORBUG-28829)
their position
([QTCREATORBUG-28829](https://bugreports.qt.io/browse/QTCREATORBUG-28829))
* Improved the selection and navigation in the `Issues` view
(QTCREATORBUG-26128, QTCREATORBUG-27006, QTCREATORBUG-27506)
([QTCREATORBUG-26128](https://bugreports.qt.io/browse/QTCREATORBUG-26128),
[QTCREATORBUG-27006](https://bugreports.qt.io/browse/QTCREATORBUG-27006),
[QTCREATORBUG-27506](https://bugreports.qt.io/browse/QTCREATORBUG-27506))
* Fixed a crash with a large number of search hits from Silver Searcher
([QTCREATORBUG-29130](https://bugreports.qt.io/browse/QTCREATORBUG-29130))
* Locator
* Improved performance
* Added the creation of directories to the `Files in File System` filter
@@ -35,95 +99,137 @@ Editing
-------
* Improved the performance of the multi-cursor support
* Fixed the saving of hardlinked files (QTCREATORBUG-19651)
* Fixed an issue of copy and paste with multiple cursors (QTCREATORBUG-29117)
* Fixed the saving of hardlinked files
([QTCREATORBUG-19651](https://bugreports.qt.io/browse/QTCREATORBUG-19651))
* Fixed an issue of copy and paste with multiple cursors
([QTCREATORBUG-29117](https://bugreports.qt.io/browse/QTCREATORBUG-29117))
* Fixed the handling of pre-edit text for input methods
([QTCREATORBUG-29134](https://bugreports.qt.io/browse/QTCREATORBUG-29134))
### C++
* Improved the style of forward declarations in the outline (QTCREATORBUG-312)
* Improved the style of forward declarations in the outline
([QTCREATORBUG-312](https://bugreports.qt.io/browse/QTCREATORBUG-312))
* Added highlighting for typed string literals and user-defined literals
(QTCREATORBUG-28869)
* Added the option to create class members from assignments (QTCREATORBUG-1918)
([QTCREATORBUG-28869](https://bugreports.qt.io/browse/QTCREATORBUG-28869))
* Extended the `Add Class Member` refactoring action to create class
members from assignments
([QTCREATORBUG-1918](https://bugreports.qt.io/browse/QTCREATORBUG-1918))
* Fixed that generated functions did not have a `const` qualifier when
required
([QTCREATORBUG-29274](https://bugreports.qt.io/browse/QTCREATORBUG-29274))
* Fixed that locator showed both the declaration and the definition of symbols
(QTCREATORBUG-13894)
([QTCREATORBUG-13894](https://bugreports.qt.io/browse/QTCREATORBUG-13894))
* Fixed the handling of C++20 keywords and concepts
* Clangd
* Fixed that the index could be outdated after VCS operations
* Fixed the highlighting of labels
([QTCREATORBUG-27338](https://bugreports.qt.io/browse/QTCREATORBUG-27338))
* Built-in
* Fixed support for `if`-statements with initializer (QTCREATORBUG-29182)
* Fixed support for `if`-statements with initializer
([QTCREATORBUG-29182](https://bugreports.qt.io/browse/QTCREATORBUG-29182))
* Clang Format
* Fixed the conversion of tab indentation settings to Clang Format
([QTCREATORBUG-29185](https://bugreports.qt.io/browse/QTCREATORBUG-29185))
### Language Server Protocol
* Added experimental support for GitHub Copilot
([GitHub documentation](https://github.com/features/copilot))
([Qt Creator documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-copilot.html))
* Added missing actions for opening the `Call Hierarchy` (QTCREATORBUG-28839,
QTCREATORBUG-28842)
* Added actions for opening the `Call Hierarchy` to the context menu of the
editor
([QTCREATORBUG-28839](https://bugreports.qt.io/browse/QTCREATORBUG-28839),
[QTCREATORBUG-28842](https://bugreports.qt.io/browse/QTCREATORBUG-28842))
### QML
* Fixed the reformatting in the presence of JavaScript directives and function
return type annotations (QTCREATORBUG-29001, QTCREATORBUG-29046)
* Fixed that reformatting changed `of` to `in` (QTCREATORBUG-29123)
* Fixed the completion for Qt Quick Controls (QTCREATORBUG-28648)
return type annotations
([QTCREATORBUG-29001](https://bugreports.qt.io/browse/QTCREATORBUG-29001),
[QTCREATORBUG-29046](https://bugreports.qt.io/browse/QTCREATORBUG-29046))
* Fixed that reformatting changed `of` to `in`
([QTCREATORBUG-29123](https://bugreports.qt.io/browse/QTCREATORBUG-29123))
* Fixed the completion for Qt Quick Controls
([QTCREATORBUG-28648](https://bugreports.qt.io/browse/QTCREATORBUG-28648))
* Fixed that `qmllint` issues were not shown in the `Issues` view
([QTCREATORBUG-28720](https://bugreports.qt.io/browse/QTCREATORBUG-28720))
### Python
* Added the option to create a virtual environment (`venv`) to the Python
interpreter selector and the wizard (PYSIDE-2152)
interpreter selector and the wizard
([PYSIDE-2152](https://bugreports.qt.io/browse/PYSIDE-2152))
* Fixed that too many progress indicators could be created
([QTCREATORBUG-29224](https://bugreports.qt.io/browse/QTCREATORBUG-29224))
### Markdown
* Added a Markdown editor with preview (QTCREATORBUG-27883)
* Added a wizard for Markdown files (QTCREATORBUG-29056)
([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-python-development.html))
Projects
--------
* Made it possible to add devices without going through the wizard
* Added support for moving files to a different directory when renaming
(QTCREATORBUG-15981)
* Made it possible to add devices in `Preferences > Devices > Add` without going
through the wizard
* Added support for moving files to a different directory when renaming them in
the `File System` view
([QTCREATORBUG-15981](https://bugreports.qt.io/browse/QTCREATORBUG-15981))
([Documentation](https://doc.qt.io/qtcreator/creator-file-system-view.html))
### CMake
* Implemented adding files to the project (QTCREATORBUG-25922,
QTCREATORBUG-26006, QTCREATORBUG-27213, QTCREATORBUG-27538,
QTCREATORBUG-28493, QTCREATORBUG-28904, QTCREATORBUG-28985,
QTCREATORBUG-29006)
* Implemented adding files to the project
([QTCREATORBUG-25922](https://bugreports.qt.io/browse/QTCREATORBUG-25922),
[QTCREATORBUG-26006](https://bugreports.qt.io/browse/QTCREATORBUG-26006),
[QTCREATORBUG-27213](https://bugreports.qt.io/browse/QTCREATORBUG-27213),
[QTCREATORBUG-27538](https://bugreports.qt.io/browse/QTCREATORBUG-27538),
[QTCREATORBUG-28493](https://bugreports.qt.io/browse/QTCREATORBUG-28493),
[QTCREATORBUG-28904](https://bugreports.qt.io/browse/QTCREATORBUG-28904),
[QTCREATORBUG-28985](https://bugreports.qt.io/browse/QTCREATORBUG-28985),
[QTCREATORBUG-29006](https://bugreports.qt.io/browse/QTCREATORBUG-29006))
* Added `Build > Reload CMake Presets` to reload CMake presets after making
changes to them
* Added support for `block()` and `endblock()`
* Fixed that CMake Presets were not visible in `Projects` view
([QTCREATORBUG-28966](https://bugreports.qt.io/browse/QTCREATORBUG-28966))
* Fixed issues with detecting a configured Qt version when importing a build
(QTCREATORBUG-29075)
([QTCREATORBUG-29075](https://bugreports.qt.io/browse/QTCREATORBUG-29075))
### Python
* Added an option for the interpreter to the wizards
### vcpkg
* Added experimental support for `vcpkg`
([vcpgk documentation](https://vcpkg.io/en/))
* Added an option for the `vcpkg` installation location
* Added a search dialog for packages
* Added a wizard and an editor for `vcpkg.json` files
* Added an option for selecting the interpreter to the wizards in
`File > New Project > Application (Qt for Python)`
Debugging
---------
* Improved the UI for enabling and disabling debuggers (QTCREATORBUG-28627)
* Improved the UI for enabling and disabling debuggers in `Projects > Run >
Debugger settings`
([QTCREATORBUG-28627](https://bugreports.qt.io/browse/QTCREATORBUG-28627))
* Fixed the automatic source mapping for Qt versions from an installer
([QTCREATORBUG-28950](https://bugreports.qt.io/browse/QTCREATORBUG-28950))
* Fixed pretty printer for `std::string` for recent `libc++`
([QTCREATORBUG-29230](https://bugreports.qt.io/browse/QTCREATORBUG-29230))
### C++
* Added an option for the default number of array elements to show
(`Preferences > Debugger > Locals & Expressions > Default array size`)
* Fixed debugging in a terminal as the root user
([QTCREATORBUG-27519](https://bugreports.qt.io/browse/QTCREATORBUG-27519))
* CDB
* Added automatic source file mapping for Qt packages
* Fixed the variables view on remote Windows devices (QTCREATORBUG-29000)
* Fixed the variables view on remote Windows devices
([QTCREATORBUG-29000](https://bugreports.qt.io/browse/QTCREATORBUG-29000))
* LLDB
* Fixed that long lines in the application output were broken into multiple
lines (QTCREATORBUG-29098)
lines
([QTCREATORBUG-29098](https://bugreports.qt.io/browse/QTCREATORBUG-29098))
### Qt Quick
* Improved the auto-detection if QML debugging is required (QTCREATORBUG-28627)
* Improved the auto-detection if QML debugging is required
([QTCREATORBUG-28627](https://bugreports.qt.io/browse/QTCREATORBUG-28627))
* Added an option for disabling static analyzer messages to
`Qt Quick > QML/JS Editing` (QTCREATORBUG-29095)
`Qt Quick > QML/JS Editing`
([QTCREATORBUG-29095](https://bugreports.qt.io/browse/QTCREATORBUG-29095))
Analyzer
--------
@@ -131,11 +237,8 @@ Analyzer
### Clang
* Fixed that a `.clang-tidy` file in the project directory was not used by
default (QTCREATORBUG-28852)
### Axivion
* Added experimental support
default
([QTCREATORBUG-28852](https://bugreports.qt.io/browse/QTCREATORBUG-28852))
Version Control Systems
-----------------------
@@ -143,7 +246,8 @@ Version Control Systems
### Git
* Instant Blame
* Improved the performance (QTCREATORBUG-29151)
* Improved the performance
([QTCREATORBUG-29151](https://bugreports.qt.io/browse/QTCREATORBUG-29151))
* Fixed that it did not show at the end of the document
Platforms
@@ -151,7 +255,8 @@ Platforms
### Android
* Fixed an issue with building library targets (QTCREATORBUG-26980)
* Fixed an issue with building library targets
([QTCREATORBUG-26980](https://bugreports.qt.io/browse/QTCREATORBUG-26980))
### Remote Linux
@@ -159,14 +264,16 @@ Platforms
### Docker
* Added support for `qmake` based projects (QTCREATORBUG-29140)
* Added support for `qmake` based projects
([QTCREATORBUG-29140](https://bugreports.qt.io/browse/QTCREATORBUG-29140))
* Fixed issues after deleting the Docker image for a registered Docker device
(QTCREATORBUG-28880)
([QTCREATORBUG-28880](https://bugreports.qt.io/browse/QTCREATORBUG-28880))
### QNX
* Added `slog2info` as a requirement for devices
* Fixed the support for remote working directories (QTCREATORBUG-28900)
* Fixed the support for remote working directories
([QTCREATORBUG-28900](https://bugreports.qt.io/browse/QTCREATORBUG-28900))
Credits for these changes go to:
--------------------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2022 The Qt Company Ltd.
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
// **********************************************************************
@@ -44,6 +44,11 @@
example, and use the results to make the tests more efficient and
complete.
\li \l{Static Code Analysis}{Axivion}
Do static code analysis and architecture analysis to detect and
eliminate unnecessary complexity of code.
\li \l{Using Valgrind Code Analysis Tools}{Valgrind Code Analysis Tools}
Detect problems in memory management by using the Memcheck

View File

@@ -0,0 +1,109 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\previouspage creator-coco.html
\page creator-axivion.html
\nextpage creator-valgrind-overview.html
\title Static Code Analysis
\l{https://www.axivion.com/en/products/axivion-suite/}{Axivion Suite} is
a tool suite for protecting software from erosion. Static code analysis,
architecture analysis, and code-smells-detection enable you to:
\list
\li Check the source code for potential runtime errors.
\li Use metrics to generate quantitative information about the
internal quality of the source code.
\li Run style checks to achieve compliance with coding guidelines.
\li Detect both duplicates and similar pieces of code in the source code.
\li Recognize cyclical dependencies at different levels.
\li Detect unreachable code.
\endlist
The experimental Axivion plugin integrates the Axivion dashboard server into
\QC.
To use the plugin, you must set up a project in the Axivion dashboard
server and link to it from \QC. You can then see style violations in the
\uicontrol Edit mode and descriptions and issue counts in the
\uicontrol Axivion view.
The editor shows style violations as inline annotations. Hover the mouse over
an annotation to bring up a tool tip with a short description of the issue.
\image qtcreator-axivion-annotation.webp {Annotation popup}
Select the \inlineimage icons/info.png
button to view detailed information about the issue in the \uicontrol Axivion
view.
\image qtcreator-axivion-view-rule.webp {Axivion view}
To view the issue counts, select \inlineimage icons/home.png
(\uicontrol {Show Dashboard}).
\section1 Enabling the Axivion Plugin
To enable the Axivion plugin:
\list 1
\li Select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {Code Analyzer} > \uicontrol Axivion to enable the plugin.
\li Select \uicontrol {Restart Now} to restart \QC and load the plugin.
\endlist
\section1 Connecting to Axivion Dashboard Servers
To connect to Axivion:
\list 1
\li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Axivion.
\image qtcreator-preferences-axivion.webp {General tab in Axivion Preferences}
\li Select \uicontrol Edit to create a connection to the Axivion
dashboard server.
\image qtcreator-edit-dashboard-configuration.webp {Edit Dashboard Configuration dialog}
\li In \uicontrol {Dashboard URL}, enter the URL of the server.
\li In \uicontrol Description, enter a free-text description of the
server.
\li In \uicontrol {Access token}, enter the IDE application token that
you created in the server, in user preferences.
\endlist
\section1 Linking to Dashboards
To link a project to a dashboard:
\list 1
\li \uicontrol Projects > \uicontrol {Project Settings} >
\uicontrol Axivion.
\image qtcreator-preferences-axivion-project.webp {Axivion settings in Project Settings}
\li Select \uicontrol {Fetch Projects} to list projects from Axivion.
\li Select a project, and then select \uicontrol {Link Project} to link
to it.
\endlist
To unlink a project, select \uicontrol {Unlink Project}.
\section1 Viewing Issue Counts
\image qtcreator-axivion-view.webp {Axivion view}
The \uicontrol Axivion view lists the numbers of the following types of
issues that Axivion found in the linked project:
\list
\li \uicontrol AV - architecture violations, such as hidden dependencies
\li \uicontrol CL - duplicates and similar pieces of code
\li \uicontrol CY - call, component, and include cycles
\li \uicontrol DE - dead code
\li \uicontrol MV - violations of metrics based on lines and tokens,
nesting, cyclomatic complexity, control flow, and so on.
\li \uicontrol SV - style violations, such as deviations from the naming
or coding conventions
\endlist
To clear the view, select \inlineimage icons/clean_pane_small.png
(\uicontrol Clear).
*/

View File

@@ -4,7 +4,7 @@
/*!
\previouspage creator-qml-performance-monitor.html
\page creator-coco.html
\nextpage creator-valgrind-overview.html
\nextpage creator-axivion.html
\title Checking Code Coverage

View File

@@ -8,7 +8,7 @@
// **********************************************************************
/*!
\previouspage creator-coco.html
\previouspage creator-axivion.html
\page creator-valgrind-overview.html
\nextpage creator-analyzer.html

View File

@@ -1,10 +1,10 @@
// Copyright (C) 2022 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-settings.html
\page creator-build-settings-cmake.html
\nextpage creator-build-settings-qmake.html
\nextpage creator-build-settings-cmake-presets.html
\title CMake Build Configuration
@@ -30,6 +30,9 @@
Select \uicontrol {Kit Configuration} to edit the CMake settings for the
build and run kit selected for the project.
You can use \l{CMake Presets}{CMake presets} files to specify common
configure, build, and test options and share them with others.
\section1 Initial Configuration
\image qtcreator-build-settings-cmake-initial.webp {Initial CMake configuration}
@@ -57,224 +60,6 @@
\l{CMake: cmake-variables(7)}. For more information about Qt-specific
variables, see \l{CMake Variable Reference}.
\section1 CMake Presets
You can use CMake presets files to specify common configure, build, and test
options and share them with others. \c CMakePresets.json has options for
project-wide builds, whereas \c CMakeUserPresets.json has options for
your local builds.
Create the presets files in the format described in
\l{https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html}
{cmake-presets(7)} and store them in project's root directory.
\QC supports presets up to version 3 (introduced in CMake 3.21), but does not
enforce version checking. It reads and uses all the fields from version 3 if
present. It does not support test presets.
You can import the presets the first time you \l {Opening Projects}
{open a project}, when no \c CMakeLists.txt.user file exists or you have
disabled all kits in the project. To update changes to the
\c CMakePresets.json file, delete the \c CMakeLists.txt.user file.
\image qtcreator-cmake-presets-configure.webp {Opening a project that has CMake presets}
You can view the presets in the \uicontrol {Initial Configuration} field and
in the environment configuration field below it.
\image qtcreator-cmake-presets-environment.webp {CMake environment configuration}
\section2 Configure Presets
The following configure presets instruct CMake to use the default generator
on the platform and specify the build directory for all build types.
\c NOT_COMMON_VALUE is displayed in \uicontrol {Initial Parameters}
and \c AN_ENVIRONMENT_FLAG in the environment configuration field.
\badcode
{
"version": 1,
"configurePresets": [
{
"name": "preset",
"displayName": "preset",
"binaryDir": "${sourceDir}/build/preset",
"cacheVariables": {
"NOT_COMMON_VALUE": "NOT_COMMON_VALUE"
},
"environment": {
"AN_ENVIRONMENT_FLAG": "1"
}
}
]
}
\endcode
\section2 MinGW Example
The following example configures a Qt project with:
\list
\li MinGW compiler
\li build directory \c <sourceDir>/build-release
\li build type \c CMAKE_BUILD_TYPE as \c Release
\li generator MinGW Makefiles
\li path to a CMake executable
\li path to the Qt installation via \c CMAKE_PREFIX_PATH
\endlist
\badcode
{
"version": 1,
"configurePresets": [
{
"name": "mingw",
"displayName": "MinGW 11.2.0",
"generator": "MinGW Makefiles",
"binaryDir": "${sourceDir}/build-release",
"cmakeExecutable": "C:/Qt/Tools/CMake_64/bin/cmake.exe",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_PREFIX_PATH": "C:/Qt/6.4.0/mingw_64"
},
"environment": {
"PATH": "C:/Qt/Tools/mingw1120_64/bin;$penv{PATH}"
}
}
]
}
\endcode
To speed up the process on Windows, specify the \c CMAKE_C_COMPILER and
\c CMAKE_CXX_COMPILER in the \c cacheVariables section.
\section2 Ninja Generator Example
The following configure and build presets set Ninja Multi-Config as the
generator, add \c Debug and \c Release build steps, and specify the path
to \c ninja.exe as a value of the \c CMAKE_MAKE_PROGRAM variable:
\badcode
{
"version": 2,
"configurePresets": [
{
"name": "ninja-nmc",
"displayName": "Ninja Multi-Config MinGW",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug;Release",
"CMAKE_PREFIX_PATH": "C:/Qt/6.4.0/mingw_64"
"CMAKE_MAKE_PROGRAM": "C:/Qt/Tools/Ninja/ninja.exe"
},
"environment": {
"PATH": "c:/Qt/Tools/mingw1120_64/bin;$penv{PATH}"
}
}
],
"buildPresets": [
{
"name": "release",
"displayName": "Ninja Release",
"configurePreset": "ninja-nmc",
"configuration": "Release"
},
{
"name": "debug",
"displayName": "Ninja Debug",
"configurePreset": "ninja-nmc",
"configuration": "Debug"
}
]
}
\endcode
This example assumes that the CMake executable path is set in
\uicontrol Edit > \uicontrol Preferences > \uicontrol CMake >
\uicontrol Tools.
\section2 MSVC Example
When using MSVC compilers with NMAKE Makefiles, Ninja, or Ninja
Multi-Config generators, you can use the \c external strategy for
the \c architecture and \c toolset fields. This lets \QC set up
the Visual C++ environment before invoking CMake.
For example:
\badcode
"generator": "Ninja Multi-Config",
"toolset": {
"value": "v142,host=x64",
"strategy": "external"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
\endcode
If you use MSVC compilers with non-VS generators and have several compilers
in the \c PATH, you might also have to specify the compiler to use in
\c cacheVariables or \c environmentVariables:
\badcode
"generator": "Ninja Multi-Config",
"toolset": {
"value": "v142,host=x64",
"strategy": "external"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
}
\endcode
\section2 Using Conditions
The following configure presets are used if they match \c condition. That is,
if the \c hostSystemName equals \c Linux, the \c linux presets are used and
if it equals \c Windows, the \c windows presets are used.
\badcode
{
"version": 3,
"configurePresets": [
{
"name": "linux",
"displayName": "Linux GCC",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_PREFIX_PATH": "$env{HOME}/Qt/6.4.0/gcc_64"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
},
{
"name": "windows",
"displayName": "Windows MSVC",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_PREFIX_PATH": "$env{SYSTEMDRIVE}/Qt/6.4.0/msvc2019_64"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
}
]
}
\endcode
\section1 Multi-Config Support
\QC supports

View File

@@ -0,0 +1,227 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\previouspage creator-build-settings-cmake.html
\page creator-build-settings-cmake-presets.html
\nextpage creator-build-settings-qmake.html
\title CMake Presets
\c CMakePresets.json has options for project-wide builds, whereas
\c CMakeUserPresets.json has options for your local builds.
Create the presets files in the format described in
\l{https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html}
{cmake-presets(7)} and store them in the project's root directory.
You can then see them in the \l {Projects} view.
\QC supports presets up to version 3 (introduced in CMake 3.21), but does not
enforce version checking. It reads and uses all the fields from version 3 if
present. It does not support test presets.
You can import the presets the first time you \l {Opening Projects}
{open a project}, when no \c CMakeLists.txt.user file exists or you have
disabled all kits in the project.
\image qtcreator-cmake-presets-configure.webp {Opening a project that has CMake presets}
You can view the presets in the \uicontrol {Initial Configuration} field and
in the environment configuration field below it.
\image qtcreator-cmake-presets-environment.webp {CMake environment configuration}
To update changes to the \c CMakePresets.json file, select \uicontrol Build >
\uicontrol {Reload CMake Presets}, and then select the presets file to load.
\section1 Configure Presets
The following configure presets instruct CMake to use the default generator
on the platform and specify the build directory for all build types.
\c NOT_COMMON_VALUE is displayed in \uicontrol {Initial Parameters}
and \c AN_ENVIRONMENT_FLAG in the environment configuration field.
\badcode
{
"version": 1,
"configurePresets": [
{
"name": "preset",
"displayName": "preset",
"binaryDir": "${sourceDir}/build/preset",
"cacheVariables": {
"NOT_COMMON_VALUE": "NOT_COMMON_VALUE"
},
"environment": {
"AN_ENVIRONMENT_FLAG": "1"
}
}
]
}
\endcode
\section1 MinGW Example
The following example configures a Qt project with:
\list
\li MinGW compiler
\li build directory \c <sourceDir>/build-release
\li build type \c CMAKE_BUILD_TYPE as \c Release
\li generator MinGW Makefiles
\li path to a CMake executable
\li path to the Qt installation via \c CMAKE_PREFIX_PATH
\endlist
\badcode
{
"version": 1,
"configurePresets": [
{
"name": "mingw",
"displayName": "MinGW 11.2.0",
"generator": "MinGW Makefiles",
"binaryDir": "${sourceDir}/build-release",
"cmakeExecutable": "C:/Qt/Tools/CMake_64/bin/cmake.exe",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_PREFIX_PATH": "C:/Qt/6.4.0/mingw_64"
},
"environment": {
"PATH": "C:/Qt/Tools/mingw1120_64/bin;$penv{PATH}"
}
}
]
}
\endcode
To speed up the process on Windows, specify the \c CMAKE_C_COMPILER and
\c CMAKE_CXX_COMPILER in the \c cacheVariables section.
\section1 Ninja Generator Example
The following configure and build presets set Ninja Multi-Config as the
generator, add \c Debug and \c Release build steps, and specify the path
to \c ninja.exe as a value of the \c CMAKE_MAKE_PROGRAM variable:
\badcode
{
"version": 2,
"configurePresets": [
{
"name": "ninja-nmc",
"displayName": "Ninja Multi-Config MinGW",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug;Release",
"CMAKE_PREFIX_PATH": "C:/Qt/6.4.0/mingw_64"
"CMAKE_MAKE_PROGRAM": "C:/Qt/Tools/Ninja/ninja.exe"
},
"environment": {
"PATH": "c:/Qt/Tools/mingw1120_64/bin;$penv{PATH}"
}
}
],
"buildPresets": [
{
"name": "release",
"displayName": "Ninja Release",
"configurePreset": "ninja-nmc",
"configuration": "Release"
},
{
"name": "debug",
"displayName": "Ninja Debug",
"configurePreset": "ninja-nmc",
"configuration": "Debug"
}
]
}
\endcode
This example assumes that the CMake executable path is set in
\uicontrol Edit > \uicontrol Preferences > \uicontrol CMake >
\uicontrol Tools.
\section1 MSVC Example
When using MSVC compilers with NMAKE Makefiles, Ninja, or Ninja
Multi-Config generators, you can use the \c external strategy for
the \c architecture and \c toolset fields. This lets \QC set up
the Visual C++ environment before invoking CMake.
For example:
\badcode
"generator": "Ninja Multi-Config",
"toolset": {
"value": "v142,host=x64",
"strategy": "external"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
\endcode
If you use MSVC compilers with non-VS generators and have several compilers
in the \c PATH, you might also have to specify the compiler to use in
\c cacheVariables or \c environmentVariables:
\badcode
"generator": "Ninja Multi-Config",
"toolset": {
"value": "v142,host=x64",
"strategy": "external"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
}
\endcode
\section1 Using Conditions
The following configure presets are used if they match \c condition. That is,
if the \c hostSystemName equals \c Linux, the \c linux presets are used and
if it equals \c Windows, the \c windows presets are used.
\badcode
{
"version": 3,
"configurePresets": [
{
"name": "linux",
"displayName": "Linux GCC",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_PREFIX_PATH": "$env{HOME}/Qt/6.4.0/gcc_64"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
},
{
"name": "windows",
"displayName": "Windows MSVC",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_PREFIX_PATH": "$env{SYSTEMDRIVE}/Qt/6.4.0/msvc2019_64"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
}
]
}
\endcode
*/

View File

@@ -181,6 +181,22 @@
current project.
\endlist
\section1 Managing Files
When you use project wizard templates to \l{Creating Files}{add files} to
a project, \QC automatically adds them to the \c {qt_add_executable()},
\c {add_executable()}, or \c {qt_add_library()} function in the
CMakeLists.txt file.
If you use custom API, \QC uses \c {target_sources()} to add the files.
For Qt Quick projects, the files are added to the \c {qt_add_qml_module()}
function, prefixed with the \c QML_FILES, \c SOURCES, or \c RESOURCES
function argument.
When you rename or remove files in the \l {Projects} or \l {File System}
view, \QC renames them in the CMakeLists.txt file or removes them from it.
\section1 Adding External Libraries to CMake Projects
Through external libraries, \QC can support code completion and syntax

View File

@@ -4,7 +4,7 @@
/*!
\page creator-project-conan.html
\previouspage creator-project-incredibuild.html
\nextpage creator-cli.html
\nextpage creator-vcpkg.html
\title Setting Up Conan

View File

@@ -42,9 +42,11 @@
\section2 Debugging Qt Quick UI Projects
\endif
To debug Qt Quick UI projects (.qmlproject), select the
\uicontrol {Enable QML} check box in \uicontrol {Debugger settings}
in \uicontrol Projects mode \uicontrol {Run Settings}.
To debug Qt Quick UI projects (.qmlproject), select \uicontrol Automatic
or \uicontrol Enabled in \uicontrol{Run Settings} >
\uicontrol {Debugger Settings} > \uicontrol {QML debugger}.
\image qtquick-debugger-settings.webp {Debugger settings section in Run Settings}
\if defined(qtcreator)
\section2 Debugging Qt Quick Applications
@@ -65,9 +67,13 @@
functions. Therefore, you must make sure that the port is properly
protected by a firewall.
\li In \uicontrol {Run Settings} > \uicontrol {Debugger settings}, select
the \uicontrol {Enable QML} check box to enable QML debugging for
running applications.
\li In \uicontrol {Run Settings} > \uicontrol {Debugger settings} >
\uicontrol {QML debugger}, select \uicontrol Automatic or
\uicontrol Enabled to enable QML debugging for running applications.
To debug both the C++ and QML parts of your application at the same
time, also select \uicontrol Automatic or \uicontrol Enabled in
\uicontrol {C++ debugger}.
\li Select \uicontrol Build > \uicontrol {Rebuild Project} to clean and
rebuild the project.
@@ -119,17 +125,8 @@
For example, for qmake the global setting only affects build configurations
that are automatically created when enabling a kit. Also, CMake ignores the
global setting.
\section1 Mixed C++/QML Debugging
To debug both the C++ and QML parts of your application at the same time,
select the \uicontrol {Enable C++} and \uicontrol {Enable QML} checkboxes for both
languages in the \uicontrol {Debugger Settings} section in the project
\uicontrol{Run Settings}.
\endif
\image qtquick-debugging-settings.png {Debugger settings section in Run Settings}
\section1 Starting QML Debugging
To start the application, choose \uicontrol Debug > \uicontrol {Start Debugging}

View File

@@ -13,8 +13,8 @@
container operates like a virtual machine but uses less system resources at
the cost of being less flexible.
Docker support is experimental. While Linux, \macos, and Windows hosts are
supported in principle, Linux is the recommended platform.
While Linux, \macos, and Windows hosts are supported in principle, Linux is
the recommended platform.
Currently, only CMake is supported for building applications in the Docker
container.
@@ -29,16 +29,6 @@
\l{https://docs.docker.com/engine/reference/commandline/pull/}{docker pull}
command.
\section1 Enabling Docker Plugin
To enable the experimental Docker plugin:
\list 1
\li In \QC, select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol Utilities > \uicontrol {Docker (experimental)}.
\li Select \uicontrol {Restart Now} to restart \QC and load the plugin.
\endlist
\section1 Adding Docker Images as Devices
To add a Docker image as a device:

View File

@@ -81,7 +81,7 @@
\li \l {Using GitHub Copilot}
The experimental Copilot plugin integrates
The Copilot plugin (disabled by default) integrates
\l{https://github.com/features/copilot}{GitHub Copilot} into \QC.
You can view suggestions from Copilot in the code editor.

View File

@@ -8,7 +8,7 @@
\title Using GitHub Copilot
The experimental Copilot plugin integrates
The Copilot plugin (disabled by default) integrates
\l{https://github.com/features/copilot}{GitHub Copilot} into \QC.
You can view suggestions from Copilot in the \uicontrol Edit mode.

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2022 The Qt Company Ltd.
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
// **********************************************************************
@@ -433,13 +433,19 @@
\row
\li Find references to symbol under cursor
\li Ctrl+Shift+U
\if defined(qtcreator)
\note If this keyboard shortcut does not work on Linux, see
\l {Editing Issues}.
\endif
\row
\li Follow symbol under cursor
Works with namespaces, classes, functions, variables, include
statements, and macros. Also, opens URLs in the default browser
\if defined(qtcreator)
and Qt resource files (.qrc) in the \l{Resource Files}
{resource editor}
\endif
\li F2
\row
\li Rename symbol under cursor

View File

@@ -8,7 +8,7 @@
// **********************************************************************
/*!
\previouspage creator-project-conan.html
\previouspage creator-vcpkg.html
\page creator-cli.html
\nextpage creator-keyboard-shortcuts.html

View File

@@ -0,0 +1,88 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page creator-vcpkg.html
\previouspage creator-project-conan.html
\nextpage creator-cli.html
\title Managing Packages with vcpkg
The experimental vcpkg plugin integrates the \l {https://vcpkg.io/en/}{vcpkg}
C/C++ package manager into \QC. It's available on all the
\l{Supported Platforms}{supported development platforms}.
You can use \QC to create and edit vcpkg.json files to specify packages to
build as part of your project when using CMake as the build system.
\section1 Enabling the vcpkg Plugin
To enable the vcpkg plugin:
\list 1
\li Select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol Utilities > \uicontrol Vcpkg to enable the plugin.
\li Select \uicontrol {Restart Now} to restart \QC and load the plugin.
\endlist
\section1 Setting vcpkg Preferences
By default, vcpkg is automatically set up for use with CMake. To disable
automatic setup, select \uicontrol Edit > \uicontrol Preferences >
\uicontrol CMake > \uicontrol General >
\uicontrol {Package manager auto setup}.
\image qtcreator-preferences-cmake-general.webp {General tab in CMake Preferences}
To set the \uicontrol Path to the directory where you installed vcpkg, select
\uicontrol Edit > \uicontrol Preferences > \uicontrol CMake >
\uicontrol Vcpkg.
\image qtcreator-preferences-cmake-vcpkg.webp {Vcpkg tab in CMake Preferences}
Select \inlineimage icons/online.png
to download vcpkg if you have not installed it yet.
\section1 Creating 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}
\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 Dependencies, enter the packages to manage.
You can add packages later in a manifest editor.
\li Select \uicontrol Next to open the \uicontrol {Project Management}
page.
\li Select \uicontrol Finish to create the file.
\endlist
The wizard automatically adds the vcpkg.json file to the CMakeLists.txt file
of the project.
\section1 Selecting Packages to Manage
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}
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 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.
*/

View File

@@ -33,9 +33,15 @@
\section1 Adding Boot2Qt Devices
If \QC does not automatically detect a device you connected with USB, you can
use a wizard to create either a network connection or a USB connection to
it.
If \QC does not automatically detect a device you connected with USB, select
\uicontrol Edit > \uicontrol Preferences > \uicontrol Devices >
\uicontrol Devices > \uicontrol Add > \uicontrol {Boot2Qt Device} to create
either a network connection or a USB connection to it.
\image qtcreator-boot2qt-device-configurations.webp {Devices tab in Preferences}
To add a device without using a wizard, select \uicontrol {Boot2Qt Device} in
the pull-down menu of the \uicontrol Add button.
\note On Ubuntu Linux, the development user account must have access to the
plugged-in devices. To grant them access to the device via USB, create a new
@@ -46,8 +52,6 @@
You can edit the settings later in \uicontrol Edit > \uicontrol Preferences >
\uicontrol Devices > \uicontrol Devices.
\image qtcreator-boot2qt-device-configurations.png {Devices dialog}
To reboot the selected device, select \uicontrol {Reboot Device}.
To restore the default application to the device, select
@@ -122,6 +126,10 @@
parameters that have sensible default values. One of
these is the SSH port number, which is available in
the variable \c %{Device:SshPort}.
To add a device without using the wizard, select
\uicontrol {Boot2Qt Device} in the pull-down menu of the
\uicontrol Add button.
\endlist
\li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits >
\uicontrol Add to add a kit for building applications for the

View File

@@ -107,6 +107,9 @@
All of these parameters can be edited later, as well as additional ones that the
wizard does not show because there are sensible default values.
To add a device without using the wizard, select
\uicontrol {Add Remote Linux Device} in the pull-down
menu of the \uicontrol Add button.
\li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits >
\uicontrol Add to add a kit for building for the device. Select the

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2019 The Qt Company Ltd.
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
// **********************************************************************
@@ -68,6 +68,23 @@
\li Code completion does not support typedefs for nested classes.
\li When developing on Linux, the \key {Ctrl+Shift+U} keyboard shortcut
might not work because it conflicts with a shortcut of the
Intelligent Input Bus (ibus). You can change either the shortcut in
\QC or the conflicting shortcut in ibus.
To set another \l {Keyboard Shortcuts}{keyboard shortcut}
in \QC, select \uicontrol Edit > \uicontrol Preferences >
\uicontrol Environment > \uicontrol Keyboard.
To change the ibus shortcut, enter the following command on the
command line to start ibus setup:
\badcode
ibus-setup
\endcode
Then, change the unicode code point shortcut in the \uicontrol Emoji
tab to something else than \key {<Control><Shift>u}.
\endlist
\section1 Projects Issues

View File

@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\previouspage creator-build-settings-cmake.html
\previouspage creator-build-settings-cmake-presets.html
\page creator-build-settings-qmake.html
\nextpage creator-build-settings-qbs.html

View File

@@ -11,7 +11,8 @@
\image qtcreator-new-file.webp {New File wizard}
Use wizard templates to add individual files to your \l{Creating Projects}
{projects}:
{projects}. Select \uicontrol File > \uicontrol {New File} and
select the type of the file:
\list
\li \uicontrol {C/C++}: header and source files for new classes.
@@ -28,6 +29,8 @@
files.
\li \uicontrol {Java}: class files.
\li \uicontrol {Python}: class and script files for Python projects.
\li \uicontrol {vcpkg} (experimental): \l {Managing Packages with vcpkg}
{vcpkg package manager} manifest files (vcpkg.json).
\li \uicontrol {Nim} (experimental): empty Nim source and script files.
\endlist

View File

@@ -55,6 +55,12 @@
\section1 Using Project Wizards
To create a new project, select \uicontrol File > \uicontrol{New Project} and
select the type of your project. The contents of the wizard dialogs depend
on the project type and the \l{glossary-buildandrun-kit}{kits} that you
select in the \uicontrol {Kit Selection} dialog. Follow the instructions of
the wizard.
In the first step, you select a template for the project. You can filter
templates (1) to view only those that apply to a particular target platform.
@@ -117,11 +123,6 @@
\endtable
To create a new project, select \uicontrol File > \uicontrol{New Project} and
select the type of your project. The contents of the wizard dialogs depend
on the project type and the \l{glossary-buildandrun-kit}{kits} that you select in the
\uicontrol {Kit Selection} dialog. Follow the instructions of the wizard.
For examples of creating different types of projects, see
\l{Tutorials}.

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
// **********************************************************************
@@ -67,6 +67,12 @@
project. You can use Conan with most build systems integrated into
\QC.
\li \l{Managing Packages with vcpkg}
The experimental vcpkg plugin integrates the
\l {https://vcpkg.io/en/}{vcpkg} C/C++ package manager into \QC.
Create and edit vcpkg.json files to specify packages to build as
part of your project when using CMake as the build system.
\endlist
*/

View File

@@ -35,7 +35,7 @@
\endlist
For more information about the CallGrind and MemCheck settings, see:
For more information about the Callgrind and Memcheck settings, see:
\list

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2022 The Qt Company Ltd.
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
@@ -6,10 +6,11 @@
\section1 Enabling Debugging
\image qtquick-debugging-settings.png "Debugger Settings"
\image qtquick-debugger-settings.webp "Debugger Settings"
To select the languages to debug, select the \uicontrol {Enable C++} and
\uicontrol {Enable QML} check boxes.
To select the languages to debug, select \uicontrol Automatic
or \uicontrol Enabled in \uicontrol {Debugger Settings} >
\uicontrol {C++ debugger} and \uicontrol {QML debugger}.
\note Opening a socket at a well-known port presents a security risk. Anyone
on the Internet could connect to the application that you are debugging and
@@ -28,6 +29,11 @@
However, you can usually leave this field empty.
\note To create a build configuration that supports debugging for a
Qt Quick application project, you also need to \l {Using Default Values}
{enable QML debugging} either globally or in the \uicontrol {Build Settings}
of the project.
For more information about debugging, see \l{Debugging}.
//! [run settings debugger]

View File

@@ -68,6 +68,9 @@
\li \l{Specifying Build Settings}
\list
\li \l{Cmake Build Configuration}
\list
\li \l{CMake Presets}
\endlist
\li \l{qmake Build Configuration}
\li \l{Qbs Build Configuration}
\li \l{Meson Build Configuration}
@@ -202,6 +205,7 @@
\list
\li \l{Profiling QML Applications}
\li \l{Checking Code Coverage}
\li \l{Static Code Analysis}
\li \l{Using Valgrind Code Analysis Tools}
\list
\li \l{Detecting Memory Leaks with Memcheck}
@@ -235,6 +239,7 @@
\li \l{Setting Up Meson}
\li \l{Setting Up IncrediBuild}
\li \l{Setting Up Conan}
\li \l{Managing Packages with vcpkg}
\endlist
\li \l{Using Command Line Options}
\li \l{Keyboard Shortcuts}

View File

@@ -60,9 +60,12 @@
\li Open a terminal window in the selected directory or in the directory
that has the file. To specify the terminal to use on Linux and
\macos, select \uicontrol Edit > \uicontrol Preferences >
\uicontrol Environment > \uicontrol System. To use an \l{Terminal}
{internal terminal}, select \uicontrol Edit > \uicontrol Preferences
> \uicontrol Terminal > \uicontrol {Use internal terminal}.
\uicontrol Environment > \uicontrol System.
\if defined(qtcreator)
To use an \l{Terminal} {internal terminal}, select \uicontrol Edit >
\uicontrol Preferences > \uicontrol Terminal >
\uicontrol {Use internal terminal}.
\endif
\li Search from the selected directory.
\li View file properties, such as name, path, MIME type, default editor,
line endings, indentation, owner, size, last read and modified
@@ -73,7 +76,10 @@
\else
\l{Creating Files}.
\endif
\li Rename or remove existing files.
\li Rename existing files. To move the file to another directory, enter
the relative or absolute path to its new location in addition to the
new filename.
\li Remove existing files.
\li Create new folders.
\li Compare the selected file with the currently open file in the diff
editor. For more information, see \l{Comparing Files}.

View File

@@ -66,10 +66,11 @@
\else
\l{Creating Files}.
\endif
\li Rename or remove existing files. If you change the base name of a
\li Rename existing files. If you change the base name of a
file, \QC displays a list of other files with the same base name
and offers to rename them as well. If you rename a UI file (.ui),
\QC also changes corresponding include statements accordingly.
\li Remove existing files.
\if defined(qtcreator)
\li Remove existing directories from \l{Setting Up a Generic Project}
{generic projects}.
@@ -79,14 +80,16 @@
\li Add and remove subprojects.
\li Find unused functions.
\endif
\li Search from the selected directory.
\li Open a terminal window in the project directory. To specify the
terminal to use on Linux and \macos, select \uicontrol Edit >
\uicontrol Preferences > \uicontrol Environment > \uicontrol System.
\if defined(qtcreator)
To use an \l{Terminal}{internal terminal}, select \uicontrol Edit >
\uicontrol Preferences > \uicontrol Terminal >
\uicontrol {Use internal terminal}.
\endif
\li Open a terminal window in the project directory that you configured
for building or running the project.
\li Expand or collapse the tree view to show or hide all files and

View File

@@ -392,6 +392,10 @@
\li \uicontrol{General Messages}
\if defined(qtcreator)
\li \l {Static Code Analysis}{Axivion}
\endif
\li \uicontrol{Version Control}
\if defined(qtcreator)
@@ -476,6 +480,9 @@
\list
\if defined(qtdesignstudio)
\li \uicontrol {Asset Export} - Errors and warnings encountered
while exporting assets.
\li \uicontrol {Asset Importer Error} - Errors and warnings encountered
while importing assets from a design tool.
\else
@@ -490,6 +497,8 @@
\li \uicontrol {Clang Code Model} -
\l {Parsing C++ Files with the Clang Code Model}
{Errors and warnings from the current editor}.
\li \uicontrol {Clang Tools} - Errors and warnings from
\l {Using Clang Tools}{Clang-Tidy and Clazy}
\endif
\li \uicontrol Compile - Selected output from the compiler. Open
@@ -521,14 +530,19 @@
\l{JavaScript and QML Error Codes}
{QML and JavaScript syntax errors}.
\if defined(qtcreator)
\li \uicontrol Sanitizer - Tasks created when you run an application if
you used an \e {address sanitizer} to detect memory handling issues.
\endif
\endlist
The view filters out irrelevant output from the build tools and presents the
issues in an organized way. To further filter the output by type, select
\inlineimage icons/filtericon.png
(\uicontrol {Filter Tree}) and then select a filter.
(\uicontrol {Filter Tree}) and then select a filter. To find output in the
view, enter search criteria in the \uicontrol Filter field.
\image qtcreator-issues.png "Issues"
\image qtcreator-issues.webp {Issues}
Select one or several lines to apply context-menu actions to their contents.
You can remove the selected lines or copy their contents to the clipboard.
@@ -536,15 +550,20 @@
contents of the line as search criteria or open a version control
annotation view of the line that causes the error message.
To view detailed information about the selected line (where available), press
\key Space.
To navigate to the corresponding source code, click an issue or
select \uicontrol {Show in Editor} in the context menu. The entry must contain the
name of the file where the issue was found.
To view more information about an issue in \l {Compile Output},
select \uicontrol {Show Output} in the context menu.
select \uicontrol {Show Compile Output} in the context menu.
To jump from one issue to the next or previous one, press \key F6 and
\key Shift+F6.
To jump from one issue to the next or previous
one, select \inlineimage icons/arrowup.png
and \inlineimage icons/arrowdown.png
or press \key F6 and \key Shift+F6.
By default, a new build clears the \uicontrol Issues view. To keep
the issues from the previous build rounds, deselect \uicontrol Edit >

View File

@@ -34,10 +34,10 @@
and integrated into \QC. The correct folder to place the plugins depends on
whether you use the standalone \QD or the integrated \QD.
The integrated \QD fetches plugins from the \c {\bin\plugins\designer}
directory in the \QC installation directory on Windows and Linux. For
information about how to configure plugins on \macos, see
\l{Configuring Qt Designer Plugins on \macos}.
The integrated \QD fetches plugins from the \QC installation directory.
Designer plugins are loaded from \c {<QtCreator>\bin\plugins\designer} on Windows,
\c {<QtCreator>/lib/Qt/plugins/designer} on Linux, and
\c {Qt Creator.app/Contents/PlugIns/designer} on macOS.
To check which plugins were loaded successfully and which failed, choose
\uicontrol Tools > \uicontrol {Form Editor} >
@@ -49,81 +49,21 @@
of \c bin. To check which plugins were loaded successfully and which failed,
choose \uicontrol Help > \uicontrol {About Plugins}.
\section2 Configuring Qt Designer Plugins on \macos
On \macos, a GUI application must be built and run from a bundle. A bundle
is a directory structure that appears as a single entity when viewed in the
Finder. A bundle for an application typically has the executable and
all the resources it needs.
\QC uses its own set of Qt Libraries located in the bundle, and therefore,
you need to configure the \QD plugins that you want to use with \QC.
For more information about how to deploy applications to \macos, see
\l{Qt for macOS - Deployment}.
The following example illustrates how to configure version 5.2.1 of the
\l{http://qwt.sourceforge.net/}{Qwt - Qt Widgets for Technical Applications}
library for use with \QC:
\list 1
\li To check the paths used in the Qwt library, enter the following
\c otool command:
\include doc_src_plugins.qdocinc 0
The output for Qwt 5.2.1 indicates that the plugin uses Qt core
libraries (QtDesigner, QtScript, QtXml, QtGui and QtCore) and
libqwt.5.dylib:
\include doc_src_plugins.qdocinc 1
\li You must copy the \QD plugin and the Qwt library files to the
following locations:
\list
\li \c {libqwt_designer_plugin.dylib} to
\c {Qt Creator.app/Contents/PlugIns/designer}
\li \c {libqwt.*.dylib} to \c {Qt Creator.app/Contents/Frameworks}
\endlist
Enter the following commands:
\include doc_src_plugins.qdocinc 4
\li Enter the following \c otool command to check the libraries that are
used by the Qwt library:
\include doc_src_plugins.qdocinc 2
The command returns the following output:
\include doc_src_plugins.qdocinc 3
\li Enter the following \c install_name_tool command to fix the
references of the libraries:
\include doc_src_plugins.qdocinc 5
\endlist
\section1 Matching Build Keys
The \QC that is included in pre-built Qt packages on Windows is built with
the Microsoft Visual Studio compiler, whereas the version of Qt shipped for
building applications is configured and built to use the \MinGW/g++ compiler.
Plugins built by using this version of Qt cannot be loaded by \QC because
the build-keys do not match. The plugins can only be used in the standalone
the Microsoft Visual Studio compiler. If you install a Qt version that was built
with the \MinGW/g++ compiler, plugins built with this version of Qt cannot be
loaded by \QC because the build-keys do not match.
The same is true if you use a Qt version that is newer than the Qt version that
Qt Creator was built with, or that is otherwise incompatible.
The plugins can then only be used in the standalone
version of \QD. Choose \uicontrol Help > \uicontrol {About \QC} to check the
Qt version \QC was built with.
Qt version and compiler that \QC was built with.
To use \QD plugins that were built for the shipped Qt version, make sure
that \QC is built with the same compiler by either recompiling \QC using
\MinGW or recompiling Qt with Microsoft Visual Studio, depending on which
configuration you want to use for your applications.
\MinGW or installing a Qt version that was built with Microsoft Visual Studio,
depending on which configuration you want to use for your applications.
*/

View File

@@ -16,7 +16,7 @@ headerdirs = . \
../src \
../../../src/libs/aggregation \
../../../src/libs/extensionsystem \
../../../src/libs/solutions/tasking \
../../../src/libs/solutions \
../../../src/libs/utils \
../../../src/plugins/coreplugin
@@ -24,7 +24,7 @@ sourcedirs = . \
../src \
../../../src/libs/aggregation \
../../../src/libs/extensionsystem \
../../../src/libs/solutions/tasking \
../../../src/libs/solutions \
../../../src/libs/utils \
../../../src/plugins/coreplugin
@@ -42,7 +42,8 @@ sources.fileextensions = "*.cpp *.qdoc"
imagedirs = ../images \
../../config/images \
../../qtcreator/images
../../qtcreator/images \
../../../src/libs/solutions
exampledirs = ../examples
depends += qtwidgets \

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
/*!
@@ -109,12 +109,34 @@
\endomit
\endtable
\section1 Solutions
\QC uses object libraries that are independent of any \QC-specific code, and
are threfore ready to be a part of Qt.
\table
\header
\li Solution Name
\li Description
\row
\li \l{Spinner Solution}{Spinner}
\li Renders a circular, endlessly animated progress indicator,
which may be attached to any widget as an overlay.
\row
\li \l{Tasking Solution}{Tasking}
\li Enables you to build extensible, declarative task tree structures
that contain possibly asynchronous tasks.
\endtable
\section1 Reference
\list
\li \l {Qt Creator C++ Classes}
\li \l {Qt Creator Namespaces}
\li \l {Qt Creator Functions}
\li \l {Solutions}
\endlist
*/

View File

@@ -0,0 +1,12 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
/*!
\page solutions-index.html
\title Solutions
\brief A collection of reusable object libraries.
This topic lists the available solutions:
\annotatedlist solutions-modules
*/

View File

@@ -13,6 +13,7 @@ Product {
property string fileName: FileInfo.fileName(sourceDirectory) + ".qbs"
property bool useNonGuiPchFile: false
property bool useGuiPchFile: false
property bool useQt: true
property string pathToSharedSources: FileInfo.joinPaths(path,
FileInfo.relativePath(FileInfo.joinPaths('/', qtc.ide_qbs_imports_path),
FileInfo.joinPaths('/', qtc.ide_shared_sources_path)))
@@ -28,8 +29,12 @@ Product {
enableFallback: false
}
}
Depends { name: "Qt.core"; versionAtLeast: "6.2.0" }
Depends { name: "Qt.core5compat" }
Depends {
name: "Qt"
condition: useQt
submodules: ["core", "core5compat"]
versionAtLeast: "6.2.0"
}
// TODO: Should fall back to what came from Qt.core for Qt < 5.7, but we cannot express that
// atm. Conditionally pulling in a module that sets the property is also not possible,
@@ -75,7 +80,7 @@ Product {
cpp.cxxLanguageVersion: "c++17"
cpp.defines: qtc.generalDefines
cpp.minimumWindowsVersion: "6.1"
cpp.useCxxPrecompiledHeader: useNonGuiPchFile || useGuiPchFile
cpp.useCxxPrecompiledHeader: useQt && (useNonGuiPchFile || useGuiPchFile)
cpp.visibility: "minimal"
Group {

View File

@@ -6,16 +6,16 @@ import qbs.Utilities
Module {
Depends { name: "cpp"; required: false }
property string qtcreator_display_version: '11.0.0-beta1'
property string qtcreator_display_version: '11.0.0-rc1'
property string ide_version_major: '10'
property string ide_version_minor: '0'
property string ide_version_release: '82'
property string ide_version_release: '84'
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.'
+ ide_version_release
property string ide_compat_version_major: '10'
property string ide_compat_version_minor: '0'
property string ide_compat_version_release: '82'
property string ide_compat_version_release: '84'
property string qtcreator_compat_version: ide_compat_version_major + '.'
+ ide_compat_version_minor + '.' + ide_compat_version_release

View File

@@ -1,6 +1,7 @@
# Copyright (C) 2016 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import argparse
import os
import locale
import shutil
@@ -196,13 +197,13 @@ def is_not_debug(path, filenames):
files = [fn for fn in filenames if os.path.isfile(os.path.join(path, fn))]
return [fn for fn in files if not is_debug_file(os.path.join(path, fn))]
def codesign_call():
signing_identity = os.environ.get('SIGNING_IDENTITY')
def codesign_call(identity=None, flags=None):
signing_identity = identity or os.environ.get('SIGNING_IDENTITY')
if not signing_identity:
return None
codesign_call = ['codesign', '-o', 'runtime', '--force', '-s', signing_identity,
'-v']
signing_flags = os.environ.get('SIGNING_FLAGS')
signing_flags = flags or os.environ.get('SIGNING_FLAGS')
if signing_flags:
codesign_call.extend(signing_flags.split())
return codesign_call
@@ -228,8 +229,8 @@ def conditional_sign_recursive(path, filter):
if is_mac_platform():
os_walk(path, filter, lambda fp: codesign_executable(fp))
def codesign(app_path):
codesign = codesign_call()
def codesign(app_path, identity=None, flags=None):
codesign = codesign_call(identity, flags)
if not codesign or not is_mac_platform():
return
# sign all executables in Resources
@@ -243,3 +244,20 @@ def codesign(app_path):
entitlements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'dist',
'installer', 'mac', 'entitlements.plist')
subprocess.check_call(codesign + ['--deep', app_path, '--entitlements', entitlements_path])
def codesign_main(args):
codesign(args.app_bundle, args.identity, args.flags)
def main():
parser = argparse.ArgumentParser(description='Qt Creator build tools')
subparsers = parser.add_subparsers(title='subcommands', required=True)
parser_codesign = subparsers.add_parser('codesign', description='Codesign macOS app bundle')
parser_codesign.add_argument('app_bundle')
parser_codesign.add_argument('-s', '--identity', help='Codesign identity')
parser_codesign.add_argument('--flags', help='Additional flags')
parser_codesign.set_defaults(func=codesign_main)
args = parser.parse_args()
args.func(args)
if __name__ == '__main__':
main()

View File

@@ -147,11 +147,12 @@ class Dumper(DumperBase):
code = nativeType.code()
if code == TypeCode.Pointer:
if not nativeType.name().startswith('<function>'):
if nativeType.name().startswith('<function>'):
code = TypeCode.Function
elif nativeType.targetName() != nativeType.name():
targetType = self.lookupType(nativeType.targetName(), nativeType.moduleId())
if targetType is not None:
if targetType is not None and targetType is not nativeType:
return self.createPointerType(targetType)
code = TypeCode.Function
if code == TypeCode.Array:
# cdb reports virtual function tables as arrays those ar handled separetly by

View File

@@ -1509,9 +1509,10 @@ class CliDumper(Dumper):
self.setupDumpers({})
def put(self, line):
if self.output.endswith('\n'):
self.output = self.output[0:-1]
self.output += line
if self.output:
if self.output[-1].endswith('\n'):
self.output[-1] = self.output[-1][0:-1]
self.output.append(line)
def putNumChild(self, numchild):
pass

View File

@@ -163,7 +163,123 @@ def qdump__std____1__stack(d, value):
d.putBetterType(value.type)
def std_1_string_dumper(d, value):
def GetChildMemberWithName(value: DumperBase.Value, name: str) -> DumperBase.Value:
members: list[DumperBase.Value] = value.members(True)
for member in members:
if member.name == name:
return member
return None
def GetIndexOfChildWithName(value: DumperBase.Value, name: str) -> int:
members: list[DumperBase.Value] = value.members(True)
for i, member in enumerate(members):
if member.name == name:
return i
return None
class StringLayout:
CSD = 0
DSC = 1
def std_1_string_dumper_v2(d, value):
charType = value['__l']['__data_'].dereference().type
R = GetChildMemberWithName(value, "__r_")
if not R:
raise Exception("Could not find __r_")
# __r_ is a compressed_pair of the actual data and the allocator. The data we
# want is in the first base class.
R_Base_SP = R[0]
if not R_Base_SP:
raise Exception("Could not find R_Base_SP")
Rep_Sp = GetChildMemberWithName(R_Base_SP, "__value_")
if not Rep_Sp:
raise Exception("Could not find __value_")
# Our layout seems a little different
Rep_Sp = Rep_Sp[0]
if not Rep_Sp:
raise Exception("Could not find Rep_Sp")
L = GetChildMemberWithName(Rep_Sp, "__l")
if not L:
raise Exception("Could not find __l")
layout = StringLayout.CSD
if GetIndexOfChildWithName(L, "__data_") == 0:
layout = StringLayout.DSC
short_mode = False
using_bitmasks = True
size = 0
size_mode_value = 0
Short_Sp = GetChildMemberWithName(Rep_Sp, "__s")
if not Short_Sp:
raise Exception("Could not find __s")
Is_Long: DumperBase.Value = GetChildMemberWithName(Short_Sp, "__is_long_")
Size_Sp: DumperBase.Value = GetChildMemberWithName(Short_Sp, "__size_")
if not Size_Sp:
raise Exception("Could not find __size_")
if Is_Long:
using_bitmasks = False
short_mode = Is_Long.integer() == 0
size = Size_Sp.integer()
else:
size_mode_value = Size_Sp.integer()
mode_mask = 1
if layout == StringLayout.DSC:
mode_mask = 0x80
short_mode = (size_mode_value & mode_mask) == 0
if short_mode:
Location_Sp = GetChildMemberWithName(Short_Sp, "__data_")
if using_bitmasks:
size = ((size_mode_value >> 1) % 256)
if layout == StringLayout.DSC:
size = size_mode_value
# The string is most likely not initialized yet
if size > 100 or not Location_Sp:
raise Exception("Probably not initialized yet")
d.putCharArrayHelper(d.extractPointer(Location_Sp), size,
charType, d.currentItemFormat())
return
Location_Sp = GetChildMemberWithName(L, "__data_")
Size_Vo = GetChildMemberWithName(L, "__size_")
Capacity_Vo = GetChildMemberWithName(L, "__cap_")
if not Location_Sp or not Size_Vo or not Capacity_Vo:
raise Exception("Could not find Location_Sp, Size_Vo or Capacity_Vo")
size = Size_Vo.integer()
capacity = Capacity_Vo.integer()
if not using_bitmasks and layout == StringLayout.CSD:
capacity *= 2
if capacity < size:
raise Exception("Capacity is less than size")
d.putCharArrayHelper(d.extractPointer(Location_Sp), size,
charType, d.currentItemFormat())
def std_1_string_dumper_v1(d, value):
charType = value['__l']['__data_'].dereference().type
D = None
@@ -245,13 +361,24 @@ def std_1_string_dumper(d, value):
return
def qdump__std____1__string(d, value):
std_1_string_dumper(d, value)
try:
std_1_string_dumper_v2(d, value)
except Exception as eV2:
try:
std_1_string_dumper_v1(d, value)
except Exception as eV1:
d.putValue("Could not parse: %s, %s" % (eV1, eV2))
def qdump__std____1__wstring(d, value):
std_1_string_dumper(d, value)
try:
std_1_string_dumper_v2(d, value)
except Exception as eV2:
try:
std_1_string_dumper_v1(d, value)
except Exception as eV1:
d.putValue("Could not parse: %s, %s" % (eV1, eV2))
def qdump__std____1__basic_string(d, value):

View File

@@ -1,3 +1,5 @@
{
"files": ["%{SrcFileName}"]
"files": [
"%{SrcFileName}"
]
}

View File

@@ -1,3 +1,6 @@
{
"files": ["%{SrcFileName}", "%{QmlFileName}"]
"files": [
"%{SrcFileName}",
"%{QmlFileName}"
]
}

View File

@@ -1,3 +1,6 @@
{
"files": ["%{SrcFileName}", "form.ui"]
"files": [
"%{SrcFileName}",
"form.ui"
]
}

View File

@@ -161,6 +161,11 @@
"target": "%{ProjectDirectory}/qmlcomponents",
"condition": "%{QdsProjectStyle}"
},
{
"source": "%{QdsWizardPath}/common/insight.tpl",
"target": "%{ProjectDirectory}/insight",
"condition": "%{QdsProjectStyle}"
},
{
"source": "%{QdsWizardPath}/common/main.qml",
"target": "%{ProjectDirectory}/main.qml",

View File

@@ -278,7 +278,6 @@ static Utils::QtcSettings *createUserSettings()
static void setHighDpiEnvironmentVariable()
{
if (Utils::HostOsInfo::isMacHost())
return;
@@ -293,10 +292,12 @@ static void setHighDpiEnvironmentVariable()
&& !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR")
&& !qEnvironmentVariableIsSet("QT_SCALE_FACTOR")
&& !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) {
} else {
return;
}
if (!qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY"))
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Floor);
}
}
void setPixmapCacheLimit()
@@ -494,11 +495,30 @@ int main(int argc, char **argv)
Options options = parseCommandLine(argc, argv);
applicationDirPath(argv[0]);
const bool hasStyleOption = Utils::findOrDefault(options.appArguments, [](char *arg) {
return strcmp(arg, "-style") == 0;
});
if (qEnvironmentVariableIsSet("QTC_DO_NOT_PROPAGATE_LD_PRELOAD")) {
Utils::Environment::modifySystemEnvironment(
{{"LD_PRELOAD", "", Utils::EnvironmentItem::Unset}});
}
auto restoreEnvVarFromSquish = [](const QByteArray &squishVar, const QString &var) {
if (qEnvironmentVariableIsSet(squishVar)) {
Utils::Environment::modifySystemEnvironment(
{{var, "", Utils::EnvironmentItem::Unset}});
const QString content = qEnvironmentVariable(squishVar);
if (!content.isEmpty()) {
Utils::Environment::modifySystemEnvironment(
{{var, content, Utils::EnvironmentItem::Prepend}});
}
}
};
restoreEnvVarFromSquish("SQUISH_SHELL_ORIG_DYLD_LIBRARY_PATH", "DYLD_LIBRARY_PATH");
restoreEnvVarFromSquish("SQUISH_ORIG_DYLD_FRAMEWORK_PATH", "DYLD_FRAMEWORK_PATH");
if (options.userLibraryPath) {
if ((*options.userLibraryPath).isEmpty()) {
Utils::Environment::modifySystemEnvironment(
@@ -606,10 +626,8 @@ int main(int argc, char **argv)
setPixmapCacheLimit();
loadFonts();
if (Utils::HostOsInfo::isWindowsHost()
&& !qFuzzyCompare(qApp->devicePixelRatio(), 1.0)
&& QApplication::style()->objectName().startsWith(
QLatin1String("windows"), Qt::CaseInsensitive)) {
if (Utils::HostOsInfo::isWindowsHost() && !qFuzzyCompare(qApp->devicePixelRatio(), 1.0)
&& !hasStyleOption) {
QApplication::setStyle(QLatin1String("fusion"));
}
const int threadCount = QThreadPool::globalInstance()->maxThreadCount();

View File

@@ -56,8 +56,7 @@ Project {
Depends { name: "winpty_genversion_header" }
Depends { name: "cpp" }
useNonGuiPchFile: false
useGuiPchFile: false
useQt: false
cpp.includePaths: base.concat([sourceDirectory + "/include", buildDirectory])
cpp.defines: base.concat(["WINPTY_AGENT_ASSERT",

View File

@@ -839,7 +839,7 @@ expected_str<void> DockManager::reloadActiveWorkspace()
if (!workspaces().contains(*wrk))
return make_unexpected(
Tr::tr("Cannot reload \"%1\", it is not contained in the list of workspaces")
Tr::tr("Cannot reload \"%1\". It is not in the list of workspaces.")
.arg(wrk->filePath().toUserOutput()));
const expected_str<QByteArray> data = loadWorkspace(*wrk);
@@ -903,7 +903,7 @@ expected_str<QString> DockManager::cloneWorkspace(const QString &originalFileNam
const expected_str<void> copyResult = originalPath.copyFile(clonePath);
if (!copyResult)
return make_unexpected(Tr::tr("Could not clone '%1' due to: %2")
return make_unexpected(Tr::tr("Could not clone \"%1\" due to: %2")
.arg(originalPath.toUserOutput(), copyResult.error()));
writeDisplayName(clonePath, cloneName);
@@ -1023,7 +1023,7 @@ expected_str<QString> DockManager::exportWorkspace(const QString &targetFilePath
const FilePath workspaceFile = userDirectory().pathAppended(sourceFileName);
if (!workspaceFile.exists())
return make_unexpected(
Tr::tr("Workspace does not exist '%1'").arg(workspaceFile.toUserOutput()));
Tr::tr("Workspace does not exist \"%1\"").arg(workspaceFile.toUserOutput()));
// Finally copy the workspace to the target
const expected_str<void> copyResult = workspaceFile.copyFile(targetFile);

View File

@@ -12,10 +12,10 @@ class QSpinBox;
class QDoubleSpinBox;
class QGraphicsView;
class QVariant;
QT_END_NAMESPACE
class EasingGraph;
QT_END_NAMESPACE
namespace QmlJS { class PropertyReader; }
namespace QmlEditorWidgets {

View File

@@ -20,9 +20,11 @@
#include <QtCore/qstring.h>
#include <QtCore/qstack.h>
QT_QML_BEGIN_NAMESPACE
QT_BEGIN_NAMESPACE
class QDebug;
QT_END_NAMESPACE
QT_QML_BEGIN_NAMESPACE
namespace QmlJS {

View File

@@ -697,12 +697,19 @@ Check::Check(Document::Ptr doc, const ContextPtr &context, Utils::QtcSettings *q
_enabledMessages = Utils::toSet(Message::allMessageTypes());
if (qtcSettings && qtcSettings->value("J.QtQuick/QmlJSEditor.useCustomAnalyzer").toBool()) {
auto disabled = qtcSettings->value("J.QtQuick/QmlJSEditor.disabledMessages").toList();
auto toIntList = [](const QList<StaticAnalysis::Type> list) {
return Utils::transform(list, [](StaticAnalysis::Type t) { return int(t); });
};
auto disabled = qtcSettings->value("J.QtQuick/QmlJSEditor.disabledMessages",
QVariant::fromValue(
toIntList(defaultDisabledMessages()))).toList();
for (const QVariant &disabledNumber : disabled)
disableMessage(StaticAnalysis::Type(disabledNumber.toInt()));
if (!isQtQuick2Ui()) {
auto disabled = qtcSettings->value("J.QtQuick/QmlJSEditor.disabledMessagesNonQuickUI").toList();
auto disabled = qtcSettings->value("J.QtQuick/QmlJSEditor.disabledMessagesNonQuickUI",
QVariant::fromValue(
toIntList(defaultDisabledMessagesForNonQuickUi()))).toList();
for (const QVariant &disabledNumber : disabled)
disableMessage(StaticAnalysis::Type(disabledNumber.toInt()));
}

View File

@@ -370,7 +370,7 @@ QByteArray LibraryInfo::calculateFingerprint() const
{
QCryptographicHash hash(QCryptographicHash::Sha1);
auto addData = [&hash](auto p, size_t len) {
hash.addData(QByteArrayView(reinterpret_cast<const char *>(p), len));
hash.addData(reinterpret_cast<const char *>(p), len);
};
addData(&_status, sizeof(_status));

View File

@@ -1 +1,2 @@
add_subdirectory(spinner)
add_subdirectory(tasking)

View File

@@ -46,3 +46,23 @@ integrated into Qt when they:
- Have full docs.
- Have auto tests.
- Have at least one example (however, autotests often play this role, too).
## Documentation
The common Solutions doc (doc/qtcreatordev/src/solutions-index.qdoc)
lists all the solutions added to the solutions-modules group.
In order to gather all the available solutions in this common page,
define the module and refer to it like:
/*!
\module TaskingSolution
\title The Tasking Solution
\ingroup solutions-modules
\brief (... add a brief description here...)
*/
The \ingroup will put the item above to the common Solutions page.
Don't add more \ingroup references from class docs, add \inmodule instead.

View File

@@ -2,6 +2,7 @@ Project {
name: "Solutions"
references: [
"spinner/spinner.qbs",
"tasking/tasking.qbs",
].concat(project.additionalLibs)
}

View File

@@ -0,0 +1,9 @@
add_qtc_library(Spinner OBJECT
# Never add dependencies to non-Qt libraries for this library
DEPENDS Qt::Core Qt::Widgets
PUBLIC_DEFINES SPINNER_LIBRARY
SOURCES
spinner.cpp spinner.h
spinner.qrc
spinner_global.h
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

View File

@@ -0,0 +1,249 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "spinner.h"
#include <QEvent>
#include <QPainter>
#include <QTimer>
#include <QWidget>
namespace SpinnerSolution {
class OverlayWidget : public QWidget
{
public:
using PaintFunction = std::function<void(QWidget *, QPainter &, QPaintEvent *)>;
explicit OverlayWidget(QWidget *parent = nullptr)
{
setAttribute(Qt::WA_TransparentForMouseEvents);
if (parent)
attachToWidget(parent);
}
void attachToWidget(QWidget *parent)
{
if (parentWidget())
parentWidget()->removeEventFilter(this);
setParent(parent);
if (parent) {
parent->installEventFilter(this);
resizeToParent();
raise();
}
}
void setPaintFunction(const PaintFunction &paint) { m_paint = paint; }
protected:
bool eventFilter(QObject *obj, QEvent *ev) override
{
if (obj == parent() && ev->type() == QEvent::Resize)
resizeToParent();
return QWidget::eventFilter(obj, ev);
}
void paintEvent(QPaintEvent *ev) override
{
if (m_paint) {
QPainter p(this);
m_paint(this, p, ev);
}
}
private:
void resizeToParent() { setGeometry(QRect({}, parentWidget()->size())); }
PaintFunction m_paint;
};
class SpinnerPainter
{
public:
using UpdateCallback = std::function<void()>;
SpinnerPainter(SpinnerSize size);
void setSize(SpinnerSize size);
void setUpdateCallback(const UpdateCallback &cb) { m_callback = cb; }
QSize size() const { return m_pixmap.size() / m_pixmap.devicePixelRatio(); }
void paint(QPainter &painter, const QRect &rect) const;
void startAnimation() { m_timer.start(); }
void stopAnimation() { m_timer.stop(); }
protected:
void nextAnimationStep() { m_rotation = (m_rotation + m_rotationStep + 360) % 360; }
private:
SpinnerSize m_size = SpinnerSize::Small;
int m_rotationStep = 45;
int m_rotation = 0;
QTimer m_timer;
QPixmap m_pixmap;
UpdateCallback m_callback;
};
static QString imageFileNameForSpinnerSize(SpinnerSize size)
{
switch (size) {
case SpinnerSize::Large:
return ":/icons/spinner_large.png";
case SpinnerSize::Medium:
return ":/icons/spinner_medium.png";
case SpinnerSize::Small:
return ":/icons/spinner_small.png";
}
return {};
}
SpinnerPainter::SpinnerPainter(SpinnerSize size)
{
m_timer.setSingleShot(false);
QObject::connect(&m_timer, &QTimer::timeout, &m_timer, [this] {
nextAnimationStep();
if (m_callback)
m_callback();
});
setSize(size);
}
void SpinnerPainter::setSize(SpinnerSize size)
{
m_size = size;
m_rotationStep = size == SpinnerSize::Small ? 45 : 30;
m_timer.setInterval(size == SpinnerSize::Small ? 100 : 80);
m_pixmap = QPixmap(imageFileNameForSpinnerSize(size));
}
void SpinnerPainter::paint(QPainter &painter, const QRect &rect) const
{
painter.save();
painter.setRenderHint(QPainter::SmoothPixmapTransform);
QPoint translate(rect.x() + rect.width() / 2, rect.y() + rect.height() / 2);
QTransform t;
t.translate(translate.x(), translate.y());
t.rotate(m_rotation);
t.translate(-translate.x(), -translate.y());
painter.setTransform(t);
QSize pixmapUserSize(m_pixmap.size() / m_pixmap.devicePixelRatio());
painter.drawPixmap(QPoint(rect.x() + ((rect.width() - pixmapUserSize.width()) / 2),
rect.y() + ((rect.height() - pixmapUserSize.height()) / 2)),
m_pixmap);
painter.restore();
}
class SpinnerWidget : public OverlayWidget
{
public:
explicit SpinnerWidget(SpinnerSize size, QWidget *parent = nullptr)
: OverlayWidget(parent)
, m_paint(size)
{
setPaintFunction(
[this](QWidget *w, QPainter &p, QPaintEvent *) { m_paint.paint(p, w->rect()); });
m_paint.setUpdateCallback([this] { update(); });
updateGeometry();
}
void setSize(SpinnerSize size)
{
m_paint.setSize(size);
updateGeometry();
}
QSize sizeHint() const final { return m_paint.size(); }
protected:
void showEvent(QShowEvent *) final { m_paint.startAnimation(); }
void hideEvent(QHideEvent *) final { m_paint.stopAnimation(); }
private:
SpinnerPainter m_paint;
};
/*!
\module SpinnerSolution
\title Spinner Solution
\ingroup solutions-modules
\brief Contains a Spinner solution.
The Spinner solution depends on Qt only, and doesn't depend on any \QC specific code.
*/
/*!
\namespace SpinnerSolution
\inmodule SpinnerSolution
\brief The SpinnerSolution namespace encloses the Spinner class.
*/
/*!
\enum SpinnerSolution::SpinnerSize
This enum describes the possible spinner sizes.
\value Small \inlineimage spinner/icons/spinner_small.png
\value Medium \inlineimage spinner/icons/spinner_medium.png
\value Large \inlineimage spinner/icons/spinner_large.png
*/
/*!
\class SpinnerSolution::Spinner
\inheaderfile solutions/spinner/spinner.h
\inmodule SpinnerSolution
\brief The Spinner class renders a circular, endlessly animated progress indicator,
that may be attached to any widget as an overlay.
*/
/*!
Creates a spinner overlay with a given \a size for the passed \a parent widget.
The \a parent widget takes the ownership of the created spinner.
*/
Spinner::Spinner(SpinnerSize size, QWidget *parent)
: QObject(parent)
, m_widget(new SpinnerWidget(size, parent)) {}
/*!
Sets the size of the spinner to the given \a size.
*/
void Spinner::setSize(SpinnerSize size)
{
m_widget->setSize(size);
}
/*!
Shows the animated spinner as an overlay for the parent widget
set previously in the constructor.
*/
void Spinner::show()
{
m_widget->show();
}
/*!
Hides the spinner.
*/
void Spinner::hide()
{
m_widget->hide();
}
/*!
Returns \c true if the spinner is visible; otherwise, returns \c false.
*/
bool Spinner::isVisible() const
{
return m_widget->isVisible();
}
/*!
Shows or hides the spinner depending on the value of \a visible.
By default, the spinner is visible.
*/
void Spinner::setVisible(bool visible)
{
m_widget->setVisible(visible);
}
} // namespace SpinnerSolution

View File

@@ -0,0 +1,37 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef SPINNER_H
#define SPINNER_H
#include "spinner_global.h"
#include <QObject>
namespace SpinnerSolution {
Q_NAMESPACE_EXPORT(SPINNER_EXPORT)
enum class SpinnerSize { Small, Medium, Large };
Q_ENUM_NS(SpinnerSize);
// TODO: SpinnerOverlay and SpinnerWidget?
class SPINNER_EXPORT Spinner : public QObject
{
Q_OBJECT
public:
explicit Spinner(SpinnerSize size, QWidget *parent = nullptr);
void setSize(SpinnerSize size);
void show();
void hide();
bool isVisible() const;
void setVisible(bool visible);
private:
class SpinnerWidget *m_widget = nullptr;
};
} // namespace SpinnerSolution
#endif // SPINNER_H

View File

@@ -0,0 +1,13 @@
QtcLibrary {
name: "Spinner"
Depends { name: "Qt"; submodules: ["core", "widgets"] }
cpp.defines: base.concat("SPINNER_LIBRARY")
files: [
"spinner.cpp",
"spinner.h",
"spinner.qrc",
"spinner_global.h",
]
}

View File

@@ -0,0 +1,7 @@
<RCC>
<qresource prefix="/" >
<file>icons/spinner_large.png</file>
<file>icons/spinner_medium.png</file>
<file>icons/spinner_small.png</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <qglobal.h>
#if defined(SPINNER_LIBRARY)
# define SPINNER_EXPORT Q_DECL_EXPORT
#elif defined(SPINNER_STATIC_LIBRARY)
# define SPINNER_EXPORT
#else
# define SPINNER_EXPORT Q_DECL_IMPORT
#endif

View File

@@ -83,14 +83,14 @@ public:
"It is possible that no barrier was added to the tree, "
"or the storage is not reachable from where it is referenced. "
"The WaitForBarrier task will finish with error. ");
return TaskAction::StopWithError;
return SetupResult::StopWithError;
}
Barrier *activeSharedBarrier = activeBarrier->barrier();
const std::optional<bool> result = activeSharedBarrier->result();
if (result.has_value())
return result.value() ? TaskAction::StopWithDone : TaskAction::StopWithError;
return result.value() ? SetupResult::StopWithDone : SetupResult::StopWithError;
QObject::connect(activeSharedBarrier, &Barrier::done, &barrier, &Barrier::stopWithResult);
return TaskAction::Continue;
return SetupResult::Continue;
}) {}
};

File diff suppressed because it is too large Load Diff

View File

@@ -26,12 +26,14 @@ class TASKING_EXPORT TaskInterface : public QObject
{
Q_OBJECT
public:
TaskInterface() = default;
virtual void start() = 0;
signals:
void done(bool success);
private:
template <typename Task> friend class TaskAdapter;
friend class TaskNode;
TaskInterface() = default;
virtual void start() = 0;
};
class TASKING_EXPORT TreeStorageBase
@@ -115,13 +117,13 @@ enum class WorkflowPolicy {
};
Q_ENUM_NS(WorkflowPolicy);
enum class TaskAction
enum class SetupResult
{
Continue,
StopWithDone,
StopWithError
};
Q_ENUM_NS(TaskAction);
Q_ENUM_NS(SetupResult);
class TASKING_EXPORT GroupItem
{
@@ -129,11 +131,11 @@ public:
// Internal, provided by QTC_DECLARE_CUSTOM_TASK
using TaskCreateHandler = std::function<TaskInterface *(void)>;
// Called prior to task start, just after createHandler
using TaskSetupHandler = std::function<TaskAction(TaskInterface &)>;
using TaskSetupHandler = std::function<SetupResult(TaskInterface &)>;
// Called on task done / error
using TaskEndHandler = std::function<void(const TaskInterface &)>;
// Called when group entered
using GroupSetupHandler = std::function<TaskAction()>;
using GroupSetupHandler = std::function<SetupResult()>;
// Called when group done / error
using GroupEndHandler = std::function<void()>;
@@ -228,17 +230,17 @@ private:
static GroupSetupHandler wrapGroupSetup(SetupHandler &&handler)
{
static constexpr bool isDynamic
= std::is_same_v<TaskAction, std::invoke_result_t<std::decay_t<SetupHandler>>>;
= std::is_same_v<SetupResult, std::invoke_result_t<std::decay_t<SetupHandler>>>;
constexpr bool isVoid
= std::is_same_v<void, std::invoke_result_t<std::decay_t<SetupHandler>>>;
static_assert(isDynamic || isVoid,
"Group setup handler needs to take no arguments and has to return "
"void or TaskAction. The passed handler doesn't fulfill these requirements.");
"void or SetupResult. The passed handler doesn't fulfill these requirements.");
return [=] {
if constexpr (isDynamic)
return std::invoke(handler);
std::invoke(handler);
return TaskAction::Continue;
return SetupResult::Continue;
};
};
};
@@ -290,22 +292,24 @@ private:
static_assert(isBool || isVoid,
"Sync element: The synchronous function has to return void or bool.");
if constexpr (isBool) {
return {onGroupSetup([function] { return function() ? TaskAction::StopWithDone
: TaskAction::StopWithError; })};
return {onGroupSetup([function] { return function() ? SetupResult::StopWithDone
: SetupResult::StopWithError; })};
}
return {onGroupSetup([function] { function(); return TaskAction::StopWithDone; })};
return {onGroupSetup([function] { function(); return SetupResult::StopWithDone; })};
};
};
template <typename Task>
class TaskAdapter : public TaskInterface
{
public:
protected:
using Type = Task;
TaskAdapter() = default;
Task *task() { return &m_task; }
const Task *task() const { return &m_task; }
private:
template <typename Adapter> friend class CustomTask;
Task m_task;
};
@@ -344,19 +348,19 @@ public:
private:
template<typename SetupFunction>
static GroupItem::TaskSetupHandler wrapSetup(SetupFunction &&function) {
static constexpr bool isDynamic = std::is_same_v<TaskAction,
static constexpr bool isDynamic = std::is_same_v<SetupResult,
std::invoke_result_t<std::decay_t<SetupFunction>, typename Adapter::Type &>>;
constexpr bool isVoid = std::is_same_v<void,
std::invoke_result_t<std::decay_t<SetupFunction>, typename Adapter::Type &>>;
static_assert(isDynamic || isVoid,
"Task setup handler needs to take (Task &) as an argument and has to return "
"void or TaskAction. The passed handler doesn't fulfill these requirements.");
"void or SetupResult. The passed handler doesn't fulfill these requirements.");
return [=](TaskInterface &taskInterface) {
Adapter &adapter = static_cast<Adapter &>(taskInterface);
if constexpr (isDynamic)
return std::invoke(function, *adapter.task());
std::invoke(function, *adapter.task());
return TaskAction::Continue;
return SetupResult::Continue;
};
};

View File

@@ -671,6 +671,7 @@ public:
// the validation changes focus by opening a dialog
bool m_blockAutoApply = false;
bool m_allowPathFromDevice = true;
bool m_validatePlaceHolder = false;
template<class Widget> void updateWidgetFromCheckStatus(StringAspect *aspect, Widget *w)
{
@@ -985,6 +986,13 @@ void StringAspect::setAllowPathFromDevice(bool allowPathFromDevice)
d->m_pathChooserDisplay->setAllowPathFromDevice(allowPathFromDevice);
}
void StringAspect::setValidatePlaceHolder(bool validatePlaceHolder)
{
d->m_validatePlaceHolder = validatePlaceHolder;
if (d->m_pathChooserDisplay)
d->m_pathChooserDisplay->lineEdit()->setValidatePlaceHolder(validatePlaceHolder);
}
/*!
Sets \a elideMode as label elide mode.
*/
@@ -1131,6 +1139,7 @@ void StringAspect::addToLayout(LayoutItem &parent)
d->m_pathChooserDisplay->setPromptDialogTitle(d->m_prompDialogTitle);
d->m_pathChooserDisplay->setCommandVersionArguments(d->m_commandVersionArguments);
d->m_pathChooserDisplay->setAllowPathFromDevice(d->m_allowPathFromDevice);
d->m_pathChooserDisplay->lineEdit()->setValidatePlaceHolder(d->m_validatePlaceHolder);
if (defaultValue() == value())
d->m_pathChooserDisplay->setDefaultValue(defaultValue());
else
@@ -1169,6 +1178,7 @@ void StringAspect::addToLayout(LayoutItem &parent)
d->m_lineEditDisplay->setValidationFunction(d->m_validator);
d->m_lineEditDisplay->setTextKeepingActiveCursor(displayedString);
d->m_lineEditDisplay->setReadOnly(isReadOnly());
d->m_lineEditDisplay->setValidatePlaceHolder(d->m_validatePlaceHolder);
d->updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data());
addLabeledItem(parent, d->m_lineEditDisplay);
useMacroExpander(d->m_lineEditDisplay);
@@ -1464,8 +1474,13 @@ void BoolAspect::addToLayout(Layouting::LayoutItem &parent)
d->m_button = createSubWidget<QCheckBox>();
}
switch (d->m_labelPlacement) {
case LabelPlacement::AtCheckBoxWithoutDummyLabel:
d->m_button->setText(labelText());
parent.addItem(d->m_button.data());
break;
case LabelPlacement::AtCheckBox:
d->m_button->setText(labelText());
parent.addItem(empty());
parent.addItem(d->m_button.data());
break;
case LabelPlacement::InExtraLabel:
@@ -2346,16 +2361,12 @@ void IntegersAspect::setDefaultValue(const QList<int> &value)
A text display does not have a real value.
*/
TextDisplay::TextDisplay(AspectContainer *container)
: BaseAspect(container), d(new Internal::TextDisplayPrivate)
{}
/*!
Constructs a text display showing the \a message with an icon representing
type \a type.
*/
TextDisplay::TextDisplay(const QString &message, InfoLabel::InfoType type)
: d(new Internal::TextDisplayPrivate)
TextDisplay::TextDisplay(AspectContainer *container, const QString &message, InfoLabel::InfoType type)
: BaseAspect(container), d(new Internal::TextDisplayPrivate)
{
d->m_message = message;
d->m_type = type;

View File

@@ -237,7 +237,7 @@ public:
bool defaultValue() const;
void setDefaultValue(bool val);
enum class LabelPlacement { AtCheckBox, InExtraLabel };
enum class LabelPlacement { AtCheckBox, AtCheckBoxWithoutDummyLabel, InExtraLabel };
void setLabel(const QString &labelText,
LabelPlacement labelPlacement = LabelPlacement::InExtraLabel);
void setLabelPlacement(LabelPlacement labelPlacement);
@@ -407,6 +407,7 @@ public:
void setAutoApplyOnEditingFinished(bool applyOnEditingFinished);
void setElideMode(Qt::TextElideMode elideMode);
void setAllowPathFromDevice(bool allowPathFromDevice);
void setValidatePlaceHolder(bool validatePlaceHolder);
void validateInput();
@@ -610,9 +611,9 @@ class QTCREATOR_UTILS_EXPORT TextDisplay : public BaseAspect
Q_OBJECT
public:
explicit TextDisplay(AspectContainer *container);
TextDisplay(const QString &message = {},
InfoLabel::InfoType type = InfoLabel::None);
explicit TextDisplay(AspectContainer *container,
const QString &message = {},
InfoLabel::InfoType type = InfoLabel::None);
~TextDisplay() override;
void addToLayout(Layouting::LayoutItem &parent) override;

View File

@@ -514,6 +514,9 @@ QString ProcessArgs::quoteArgUnix(const QString &arg)
QString ret(arg);
if (hasSpecialCharsUnix(ret)) {
if (arg == "&&" || arg == "||" || arg == "&" || arg == ';')
return ret;
ret.replace(QLatin1Char('\''), QLatin1String("'\\''"));
ret.prepend(QLatin1Char('\''));
ret.append(QLatin1Char('\''));
@@ -550,6 +553,9 @@ static QString quoteArgWin(const QString &arg)
QString ret(arg);
if (hasSpecialCharsWin(ret)) {
if (arg == "&&" || arg == "||" || arg == "&" || arg == ';')
return ret;
// Quotes are escaped and their preceding backslashes are doubled.
// It's impossible to escape anything inside a quoted string on cmd
// level, so the outer quoting must be "suspended".
@@ -1438,16 +1444,15 @@ CommandLine CommandLine::fromUserInput(const QString &cmdline, MacroExpander *ex
QString input = cmdline.trimmed();
QStringList result = ProcessArgs::splitArgs(cmdline, HostOsInfo::hostOs());
if (expander)
input = expander->expand(input);
const QStringList result = ProcessArgs::splitArgs(input, HostOsInfo::hostOs());
if (result.isEmpty())
return {};
auto cmd = CommandLine(FilePath::fromUserInput(result.value(0)), result.mid(1));
if (expander)
cmd.m_arguments = expander->expand(cmd.m_arguments);
return cmd;
return {FilePath::fromUserInput(result.value(0)), result.mid(1)};
}
void CommandLine::addArg(const QString &arg)

View File

@@ -117,6 +117,9 @@ bool DeviceFileAccess::ensureWritableDirectory(const FilePath &filePath) const
{
if (isWritableDirectory(filePath))
return true;
if (exists(filePath))
return false;
return createDirectory(filePath);
}
@@ -518,6 +521,9 @@ bool DesktopDeviceFileAccess::ensureWritableDirectory(const FilePath &filePath)
const QFileInfo fi(filePath.path());
if (fi.isDir() && fi.isWritable())
return true;
if (fi.exists())
return false;
return QDir().mkpath(filePath.path());
}

View File

@@ -2,6 +2,8 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "externalterminalprocessimpl.h"
#include "algorithm.h"
#include "process.h"
#include "terminalcommand.h"
#include "utilstr.h"
@@ -19,43 +21,73 @@ ProcessStubCreator::ProcessStubCreator(TerminalInterface *interface)
: m_interface(interface)
{}
static const QLatin1String TerminalAppScript{R"(
tell application "Terminal"
activate
set newTab to do script "echo Preparing terminal..."
set win to (the id of window 1 where its tab 1 = newTab) as text
do script "%1 && exit" in newTab
repeat until ((count of processes of newTab) = 0)
delay 0.1
end repeat
close window id win
end tell
)"};
expected_str<qint64> ProcessStubCreator::startStubProcess(const ProcessSetupData &setupData)
{
const TerminalCommand terminal = TerminalCommand::terminalEmulator();
if (HostOsInfo::isMacHost() && terminal.command == "Terminal.app") {
QTemporaryFile f;
f.setAutoRemove(false);
f.open();
f.setPermissions(QFile::ExeUser | QFile::ReadUser | QFile::WriteUser);
f.write("#!/bin/sh\n");
f.write(QString("cd %1\n").arg(setupData.m_workingDirectory.nativePath()).toUtf8());
f.write("clear\n");
f.write(QString("exec '%1' %2\n")
.arg(setupData.m_commandLine.executable().nativePath())
.arg(setupData.m_commandLine.arguments())
.toUtf8());
f.close();
const QString path = f.fileName();
const QString exe
= QString("tell app \"Terminal\" to do script \"'%1'; rm -f '%1'; exit\"").arg(path);
Process process;
process.setCommand({"osascript", {"-e", "tell app \"Terminal\" to activate", "-e", exe}});
process.runBlocking();
if (process.exitCode() != 0) {
return make_unexpected(
Tr::tr("Failed to start terminal process: \"%1\"").arg(process.errorString()));
}
return 0;
}
bool detached = setupData.m_terminalMode == TerminalMode::Detached;
if (HostOsInfo::isMacHost()) {
static const QMap<QString, QString> terminalMap = {
{"Terminal.app", TerminalAppScript},
};
if (terminalMap.contains(terminal.command.toString())) {
const QString env
= Utils::transform(setupData.m_environment.toStringList(), [](const QString &env) {
return CommandLine{"export", {env}}.toUserOutput();
}).join('\n');
const QString shScript = QString("cd '%1'\n%2\nclear\n'%3' %4\n")
.arg(setupData.m_workingDirectory.nativePath())
.arg(env)
.arg(setupData.m_commandLine.executable().nativePath())
.arg(setupData.m_commandLine.arguments());
Process *process = new Process(detached ? nullptr : this);
if (detached)
QObject::connect(process, &Process::done, process, &Process::deleteLater);
QTemporaryFile *shFile = new QTemporaryFile(process);
QTC_ASSERT(shFile->open(),
return make_unexpected(Tr::tr("Failed to open temporary script file.")));
shFile->write(shScript.toUtf8());
shFile->close();
FilePath::fromUserInput(shFile->fileName())
.setPermissions(QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther | QFile::ReadUser
| QFile::ReadGroup | QFile::ReadOther | QFile::WriteUser
| QFile::WriteGroup | QFile::WriteOther);
const QString script
= terminalMap.value(terminal.command.toString()).arg(shFile->fileName());
process->setCommand({"osascript", {"-"}});
process->setWriteData(script.toUtf8());
process->start();
if (!process->waitForStarted()) {
return make_unexpected(
Tr::tr("Failed to start terminal process: \"%1\".").arg(process->errorString()));
}
QObject::connect(process, &Process::done, m_interface, &TerminalInterface::onStubExited);
return 0;
}
}
Process *process = new Process(detached ? nullptr : this);
if (detached)
QObject::connect(process, &Process::done, process, &Process::deleteLater);
@@ -76,12 +108,16 @@ expected_str<qint64> ProcessStubCreator::startStubProcess(const ProcessSetupData
cmdLine.addCommandLineAsArgs(setupData.m_commandLine, CommandLine::Raw);
process->setCommand(cmdLine);
}
process->setEnvironment(
setupData.m_environment.appliedToEnvironment(Environment::systemEnvironment()));
process->setEnvironment(setupData.m_environment);
process->start();
process->waitForStarted();
if (process->error() != QProcess::UnknownError) {
return make_unexpected(
Tr::tr("Failed to start terminal process: \"%1\"").arg(process->errorString()));
Tr::tr("Failed to start terminal process: \"%1\".").arg(process->errorString()));
}
qint64 pid = process->processId();

View File

@@ -112,6 +112,7 @@ public:
bool m_isFiltering = false;
bool m_firstChange = true;
bool m_toolTipSet = false;
bool m_validatePlaceHolder = false;
QString m_lastFilterText;
@@ -469,6 +470,11 @@ QString FancyLineEdit::errorMessage() const
return d->m_errorMessage;
}
void FancyLineEdit::setValidatePlaceHolder(bool on)
{
d->m_validatePlaceHolder = on;
}
void FancyLineEdit::validate()
{
const QString t = text();
@@ -501,7 +507,8 @@ void FancyLineEdit::validate()
p.setColor(QPalette::Active, QPalette::Text,
newState == Invalid ? d->m_errorTextColor : d->m_okTextColor);
p.setColor(QPalette::Active, QPalette::PlaceholderText,
validates ? d->m_placeholderTextColor : d->m_errorTextColor);
validates || !d->m_validatePlaceHolder
? d->m_placeholderTextColor : d->m_errorTextColor);
setPalette(p);
if (validHasChanged)
@@ -545,11 +552,11 @@ IconButton::IconButton(QWidget *parent)
void IconButton::paintEvent(QPaintEvent *)
{
QWindow *window = this->window()->windowHandle();
const QPixmap iconPixmap = icon().pixmap(window, sizeHint(),
const qreal pixelRatio = window()->windowHandle()->devicePixelRatio();
const QPixmap iconPixmap = icon().pixmap(sizeHint(), pixelRatio,
isEnabled() ? QIcon::Normal : QIcon::Disabled);
QStylePainter painter(this);
QRect pixmapRect(QPoint(), iconPixmap.size() / window->devicePixelRatio());
QRect pixmapRect(QPoint(), iconPixmap.size() / pixelRatio);
pixmapRect.moveCenter(rect().center());
if (m_autoHide)

View File

@@ -105,6 +105,8 @@ public:
bool isValid() const;
QString errorMessage() const;
void setValidatePlaceHolder(bool on);
void setValidationFunction(const ValidationFunction &fn);
static ValidationFunction defaultValidationFunction();
void validate();

View File

@@ -132,7 +132,7 @@ FileStreamHandle FileStreamerManager::copy(const FilePath &source, const FilePat
if (streamer->result() == StreamResult::FinishedWithSuccess)
cont({});
else
cont(make_unexpected(Tr::tr("Failed copying file")));
cont(make_unexpected(Tr::tr("Failed copying file.")));
};
return execute(onSetup, onDone, context);
}
@@ -156,7 +156,7 @@ FileStreamHandle FileStreamerManager::read(const FilePath &source, QObject *cont
if (streamer->result() == StreamResult::FinishedWithSuccess)
cont(streamer->readData());
else
cont(make_unexpected(Tr::tr("Failed reading file")));
cont(make_unexpected(Tr::tr("Failed reading file.")));
};
return execute(onSetup, onDone, context);
}
@@ -182,7 +182,7 @@ FileStreamHandle FileStreamerManager::write(const FilePath &destination, const Q
if (streamer->result() == StreamResult::FinishedWithSuccess)
cont(0); // TODO: return write count?
else
cont(make_unexpected(Tr::tr("Failed writing file")));
cont(make_unexpected(Tr::tr("Failed writing file.")));
};
return execute(onSetup, onDone, context);
}

View File

@@ -65,7 +65,7 @@ QString JsonValue::kindToString(JsonValue::Kind kind)
JsonValue *JsonValue::build(const QVariant &variant, JsonMemoryPool *pool)
{
switch (variant.type()) {
switch (variant.typeId()) {
case QVariant::List: {
auto newValue = new (pool) JsonArrayValue;

View File

@@ -229,6 +229,7 @@ struct ResultItem
int space = -1;
int stretch = -1;
int span = 1;
bool empty = false;
};
struct Slice
@@ -287,6 +288,8 @@ static void addItemToBoxLayout(QBoxLayout *layout, const ResultItem &item)
layout->addSpacing(item.space);
} else if (!item.text.isEmpty()) {
layout->addWidget(createLabel(item.text));
} else if (item.empty) {
// Nothing to do, but no reason to warn, either.
} else {
QTC_CHECK(false);
}
@@ -346,9 +349,9 @@ void Slice::flush()
formLayout->addRow(f0.widget, f1.widget);
} else {
if (f1.layout)
formLayout->addRow(f0.text, f1.layout);
formLayout->addRow(createLabel(f0.text), f1.layout);
else if (f1.widget)
formLayout->addRow(f0.text, f1.widget);
formLayout->addRow(createLabel(f0.text), f1.widget);
}
} else {
QTC_CHECK(false);
@@ -654,8 +657,8 @@ LayoutItem empty()
LayoutItem item;
item.onAdd = [](LayoutBuilder &builder) {
ResultItem ri;
ri.span = 1;
builder.stack.last().pendingItems.append(ResultItem());
ri.empty = true;
builder.stack.last().pendingItems.append(ri);
};
return item;
}
@@ -962,6 +965,9 @@ void createItem(LayoutItem *item, const std::function<void(QObject *target)> &t)
void createItem(LayoutItem *item, QWidget *t)
{
if (auto l = qobject_cast<QLabel *>(t))
l->setTextInteractionFlags(l->textInteractionFlags() | Qt::TextSelectableByMouse);
item->onAdd = [t](LayoutBuilder &builder) { doAddWidget(builder, t); };
}

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