Merge remote-tracking branch 'origin/14.0'

Change-Id: Ic38a5b4843f174e51f5ebb97d1636a3283646c34
This commit is contained in:
Eike Ziller
2024-06-11 10:36:51 +02:00
119 changed files with 1183 additions and 500 deletions

View File

@@ -96,7 +96,7 @@ include the version number and compiler ABI. The path to the online installer
content is not enough.
Note that `/path/to/Qt` doesn't imply the full path depth like:
`$USER/Qt/6.2.4/gcc_64/lib/cmake/Qt6`, but only `$USER/Qt/6.2.4/gcc_64`.
`$USER/Qt/6.4.3/gcc_64/lib/cmake/Qt6`, but only `$USER/Qt/6.4.3/gcc_64`.
See [instructions](#getting-llvmclang-for-the-clang-code-model) on how to
get LLVM.
@@ -145,7 +145,7 @@ include the version number and compiler ABI. The path to the online installer
content is not enough.
Note that `\path\to\Qt` doesn't imply the full path depth like:
`c:\Qt\6.2.4\msvc2019_64\lib\cmake\Qt6`, but only `c:/Qt/6.2.4/msvc2019_64`.
`c:\Qt\6.4.3\msvc2019_64\lib\cmake\Qt6`, but only `c:/Qt/6.4.3/msvc2019_64`.
The usage of slashes `/` is intentional, since CMake has issues with backslashes `\`
in `CMAKE_PREFX_PATH`, they are interpreted as escape codes.
@@ -225,7 +225,7 @@ CLion...etc) locally:
"cacheVariables": {
"CMAKE_CXX_COMPILER": "cl.exe",
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_PREFIX_PATH": "c:/Qt/6.2.4/msvc2019_64"
"CMAKE_PREFIX_PATH": "c:/Qt/6.4.3/msvc2019_64"
}
}
]
@@ -313,7 +313,7 @@ http://llvm.org/docs/GettingStarted.html#git-mirror:
1. Clone LLVM/Clang and checkout a suitable branch
git clone -b release_130-based --recursive https://code.qt.io/clang/llvm-project.git
git clone -b release_17.0.6-based --recursive https://code.qt.io/clang/llvm-project.git
2. Build and install LLVM/Clang
@@ -341,16 +341,6 @@ http://llvm.org/docs/GettingStarted.html#git-mirror:
..\llvm-project\llvm
cmake --build . --target install
### Clang-Format
The ClangFormat plugin depends on the additional patch
https://code.qt.io/cgit/clang/llvm-project.git/commit/?h=release_130-based&id=42879d1f355fde391ef46b96a659afeb4ad7814a
While the plugin builds without it, it might not be fully functional.
Note that the plugin is disabled by default.
# Licenses and Attributions
Qt Creator is available under commercial licenses from The Qt Company,

294
dist/changelog/changes-14.0.0.md vendored Normal file
View File

@@ -0,0 +1,294 @@
Qt Creator 14
=============
Qt Creator version 14 contains bug fixes and new features.
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/13.0..v14.0.0
General
-------
* Added `Clear` and `Save Contents` to context menus of all output views
* Locator
* Added the option to show results relative to project root
([QTCREATORBUG-29462](https://bugreports.qt.io/browse/QTCREATORBUG-29462))
Editing
-------
* Changed the default behavior when files change on disk to
`Reload All Unchanged Editors`
* Made the search options session-specific
([QTCREATORBUG-793](https://bugreports.qt.io/browse/QTCREATORBUG-793))
* Added menus with the navigation history to the back and forward buttons
([QTCREATORBUG-347](https://bugreports.qt.io/browse/QTCREATORBUG-347))
* Added a highlight for the current view in case of multiple views
([QTCREATORBUG-23654](https://bugreports.qt.io/browse/QTCREATORBUG-23654))
* Added `Window > Reopen Last Closed Document`
* Fixed that changing a document's MIME type by renaming did not re-open it in
the new editor type when needed
([QTCREATORBUG-30317](https://bugreports.qt.io/browse/QTCREATORBUG-30317))
* Fixed that after hiding the editor in `Debug` mode, `Edit` mode always opened
when opening documents, even if an external editor window was available
([QTCREATORBUG-30408](https://bugreports.qt.io/browse/QTCREATORBUG-30408))
### C++
* Made C++ code model settings configurable per project
* Fixed indentation after function calls with subscript operator
([QTCREATORBUG-29225](https://bugreports.qt.io/browse/QTCREATORBUG-29225))
* Refactoring
* Added `Convert Function Call to Qt Meta-Method Invocation`
([QTCREATORBUG-15972](https://bugreports.qt.io/browse/QTCREATORBUG-15972))
* Added `Move Class to a Dedicated Set of Source Files`
([QTCREATORBUG-12190](https://bugreports.qt.io/browse/QTCREATORBUG-12190))
* Added `Re-order Member Function Definitions According to Declaration Order`
([QTCREATORBUG-6199](https://bugreports.qt.io/browse/QTCREATORBUG-6199))
* Added triggers for `Add Curly Braces`
* Fixed issues with macros
([QTCREATORBUG-10279](https://bugreports.qt.io/browse/QTCREATORBUG-10279))
* Clangd
* Increased the minimum version to LLVM 17
* Added an option for the index location
([QTCREATORBUG-27346](https://bugreports.qt.io/browse/QTCREATORBUG-27346))
* Made reparsing source files while editing header files optional
([QTCREATORBUG-29943](https://bugreports.qt.io/browse/QTCREATORBUG-29943))
* Fixed the handling of system headers
([QTCREATORBUG-30474](https://bugreports.qt.io/browse/QTCREATORBUG-30474))
* Built-in
* Added the option to disable the built-in indexer
([QTCREATORBUG-29147](https://bugreports.qt.io/browse/QTCREATORBUG-29147))
* Added an option for "statement macros" that are interpreted by the indenter
as complete statements that don't require a semicolon at the end
([QTCREATORBUG-13640](https://bugreports.qt.io/browse/QTCREATORBUG-13640),
[QTCREATORBUG-15069](https://bugreports.qt.io/browse/QTCREATORBUG-15069),
[QTCREATORBUG-18789](https://bugreports.qt.io/browse/QTCREATORBUG-18789))
([Clang Format Documentation](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#statementmacros))
* Added indentation support for `try-catch` statements
([QTCREATORBUG-29452](https://bugreports.qt.io/browse/QTCREATORBUG-29452))
### QML
* Improved support for enums
([QTCREATORBUG-19226](https://bugreports.qt.io/browse/QTCREATORBUG-19226))
* Added `Qt Design Studio` to `Open With` for `.ui.qml`-files
* Language Server
* Switched on by default
* Added option for generating `qmlls.ini` files for CMake projects
([QTCREATORBUG-30394](https://bugreports.qt.io/browse/QTCREATORBUG-30394))
([Qt Documentation](https://doc.qt.io/qt-6/cmake-variable-qt-qml-generate-qmlls-ini.html))
* Fixed that tool tips from the built-in model were shown instead of tool tips
from the server
### Python
* Added the option to install Python LSP updates
### Language Server Protocol
* Added support for `SymbolTag`
([Protocol Documentation](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#symbolTag))
* Added support for type hierarchy
([QTCREATORBUG-28116](https://bugreports.qt.io/browse/QTCREATORBUG-28116))
### Compiler Explorer
* Added a wizard template for code that uses Qt
### Models
* Added more visual attributes for relations
* Added support for linked files
* Added support for custom images
### SCXML
* Added visualization of conditions on transitions
([QTCREATORBUG-21946](https://bugreports.qt.io/browse/QTCREATORBUG-21946))
Projects
--------
* Added the option to hide all unconfigured kits from the list in `Projects`
mode
* Added support for user comments in the environment editor
* Fixed the parsing of file links when color was used for the output
([QTCREATORBUG-30774](https://bugreports.qt.io/browse/QTCREATORBUG-30774))
* Fixed that the column information was not used when opening files from links
in issues
* Fixed changing the case of file names on case-insensitive file systems
([QTCREATORBUG-30846](https://bugreports.qt.io/browse/QTCREATORBUG-30846))
* Fixed that Qt Creator variables were not expanded for the `Copy File`
deploy step
([QTCREATORBUG-30821](https://bugreports.qt.io/browse/QTCREATORBUG-30821))
### CMake
* Made CMake settings configurable per project
* Implemented `Open Online Documentation` for CMake documentation
* Added `Clear CMake Configuration` to the context menu in the Projects view
([QTCREATORBUG-24658](https://bugreports.qt.io/browse/QTCREATORBUG-24658))
* Fixed that the package manager auto-setup files were not removed with
`Clear CMake Configuration`
([QTCREATORBUG-30771](https://bugreports.qt.io/browse/QTCREATORBUG-30771))
* Fixed that files generated by the Qt QML CMake API were not filtered as
generated files
([QTCREATORBUG-29631](https://bugreports.qt.io/browse/QTCREATORBUG-29631))
* Presets
* Made CMake settings configurable
([QTCREATORBUG-25972](https://bugreports.qt.io/browse/QTCREATORBUG-25972),
[QTCREATORBUG-29559](https://bugreports.qt.io/browse/QTCREATORBUG-29559),
[QTCREATORBUG-30385](https://bugreports.qt.io/browse/QTCREATORBUG-30385))
* Made it possible to register debuggers
* Added support for custom build types
### Workspace
* Added `File > Open Workspace` for opening a directory as a project. A project
file `.qtcreator/project.json` in the directory is used to set a name and
file exclusion filters.
Debugging
---------
### C++
* Improved performance
* GDB
* Added a setting for `debuginfod`
([QTCREATORBUG-28868](https://bugreports.qt.io/browse/QTCREATORBUG-28868))
* CDB
* Fixed the display type of `HRESULT`
([QTCREATORBUG-30574](https://bugreports.qt.io/browse/QTCREATORBUG-30574))
Analyzer
--------
### Clang
* Added the option to `Suppress Diagnostics Inline`
([QTCREATORBUG-24847](https://bugreports.qt.io/browse/QTCREATORBUG-24847))
([Clazy Documentation](https://github.com/KDE/clazy?tab=readme-ov-file#reducing-warning-noise))
([clang-tidy Documentation](https://clang.llvm.org/extra/clang-tidy/#suppressing-undesired-diagnostics))
### Axivion
* Made it possible to register multiple servers
Terminal
--------
* Fixed resizing on Windows
([QTCREATORBUG-30558](https://bugreports.qt.io/browse/QTCREATORBUG-30558))
Version Control Systems
-----------------------
### Git
* Fixed that email and author mapping was not used for logs and showing changes
Test Integration
----------------
* Made the test timeout optional
([QTCREATORBUG-30668](https://bugreports.qt.io/browse/QTCREATORBUG-30668))
* Added a project specific option `Limit Files to Path Patterns` for restricting
the search for tests
### Qt Test
* Fixed the order of test execution
([QTCREATORBUG-30670](https://bugreports.qt.io/browse/QTCREATORBUG-30670))
Platforms
---------
### Linux
* Adapted the default theme to the system theme
* Fixed issues with light themes on dark system themes
([QTCREATORBUG-18281](https://bugreports.qt.io/browse/QTCREATORBUG-18281),
[QTCREATORBUG-20889](https://bugreports.qt.io/browse/QTCREATORBUG-20889),
[QTCREATORBUG-26817](https://bugreports.qt.io/browse/QTCREATORBUG-26817),
[QTCREATORBUG-28589](https://bugreports.qt.io/browse/QTCREATORBUG-28589),
[QTCREATORBUG-30138](https://bugreports.qt.io/browse/QTCREATORBUG-30138))
* Fixed that recent projects on unavailable remote devices regularly
froze Qt Creator
([QTCREATORBUG-30681](https://bugreports.qt.io/browse/QTCREATORBUG-30681))
### Android
* Added support for creating `android-desktop` devices
* Added support for `namespace` in `build.gradle`
([QTBUG-106907](https://bugreports.qt.io/browse/QTBUG-106907))
### iOS
* Removed Simulator management from the preferences. Use the
`Devices and Simulators` window in Xcode instead.
### Remote Linux
* Added the option to use SSH port forwarding for debugging
* Improved the performance of the generic deployment method
* Fixed that the file size check that is performed before parsing C++ files
could freeze Qt Creator until finished for remote projects
### Qt Application Manager
* Added support for the `perf` profiler
Credits for these changes go to:
--------------------------------
Ahmad Samir
Aleksei German
Alessandro Portale
Alexander Drozdov
Ali Kianian
Andre Hartmann
André Pönitz
Artem Sokolovskii
Assam Boudjelthia
BogDan Vatra
Brook Cronin
Burak Hancerli
Christian Kandeler
Christian Stenger
Cristian Adam
David Schulz
Dominik Holland
Eike Ziller
Esa Törmänen
Henning Gruendl
Jaroslaw Kobus
Jiajie Chen
Jochen Becher
Johanna Vanhatapio
Jussi Witick
Knud Dollereder
Leena Miettinen
Mahmoud Badri
Marco Bubke
Marcus Tillmanns
Mathias Hasselmann
Mats Honkamaa
Michael Weghorn
Miikka Heikkinen
Orgad Shaneh
Pranta Dastider
Robert Löhning
Sami Shalayel
Sergey Silin
Shrief Gabr
Teea Poldsam
Thiago Macieira
Thomas Hartmann
Tim Jenßen
Vikas Pachdha
Xavier Besson

View File

@@ -44,6 +44,8 @@ Editing
### Models
### SCXML
### Binary Files
Projects
@@ -57,6 +59,8 @@ Projects
### Python
### Workspace
### vcpkg
### Qt Safe Renderer
@@ -119,6 +123,8 @@ Platforms
### MCU
### Qt Application Manager
### QNX
Credits for these changes go to:

View File

@@ -100,14 +100,18 @@
\note Enable the \B2Q plugin to use it.
If \QC does not automatically detect a \l{\B2Q: Documentation}{\B2Q}
device you connect with USB:
If \QC does not automatically detect a \B2Q device you connect with USB,
check that you followed the instructions in the \l{\B2Q: Documentation}
{Quick Start Guide} for the device.
If that does not help, but you can reach the IP address of the device,
create a network connection to it:
\list 1
\li Go to \preferences > \uicontrol Devices > \uicontrol Devices.
\image qtcreator-boot2qt-device-configurations.webp {Devices tab in Preferences}
\li Select \uicontrol Add > \uicontrol {Boot2Qt Device} to create
either a network connection or a USB connection to the device.
a network connection to the device.
\image qtcreator-devices-boot2qt.png {Boot to Qt Network Device Setup wizard}
\li In \uicontrol {Device name}, enter a name for the connection.
\li In \uicontrol {Device address}, enter the host

View File

@@ -22,10 +22,10 @@
Qt versions and compilers by adding the paths to them and by creating
\l{glossary-buildandrun-kit}{kits} that use them.
To make \QC behave more like your favorite code editor or IDE, you can
change the settings for keyboard shortcuts, color schemes, generic
highlighting, code snippets, and version control systems. In addition,
you can enable and disable \QC features by managing plugins.
To make \QC behave more like your favorite code editor or IDE,
change the preferences for keyboard shortcuts, color schemes, generic
highlighting, code snippets, and version control systems. Manage plugins
to turn on and off \QC features.
The following sections summarize the options that you have and point you to
detailed information to help you specify any required settings and to make
@@ -33,8 +33,8 @@
\section1 Checking Build and Run Settings
\QC is an integrated development environment (IDE) that you can use to
develop Qt applications. While you can use \QOI to install \QC,
\QC is an integrated development environment (IDE) for creating
applications. While you can use \QOI to install \QC,
the stand-alone \QC installer never installs Qt or any Qt tools, such as
qmake. To use \QC for Qt development, you also need to install a Qt version
and a compiler. If you update the compiler version later, you
@@ -45,9 +45,7 @@
available in \QC. If it does not, you must add the kits yourself to tell
\QC where everything is.
To add kits, select \preferences > \uicontrol Kits > \uicontrol Add.
For more information, see \l{Add kits}.
To add kits, go to \preferences > \uicontrol Kits and select \uicontrol Add.
Each kit consists of a set of values that define one environment, such as a
\l{glossary-device}{device}, compiler, and Qt version. If \preferences >
@@ -57,48 +55,41 @@
If \uicontrol Auto-detected still does not show the Qt version, select
\uicontrol {Add} to add it manually.
For more information, see \l{Add Qt versions}.
Also check that \preferences > \uicontrol Kits >
\uicontrol {Compilers} shows your compiler.
For more information, see \l{Add compilers}.
Connect devices to the computer via USB to run, debug, and analyze
applications on them. You can connect Linux-based devices also
over a WLAN. Configure a connection between \QC and the computer, and
select the device in a kit.
You can connect devices to the development PC to run, debug, and
analyze applications on them from \QC. You can connect the device to the
development PC via USB. Additionally, you can connect Linux-based devices
over a WLAN. You must also configure a connection between \QC and the
development PC and specify the device in a kit.
To add devices, go to \preferences > \uicontrol Devices >
\uicontrol Devices and select \uicontrol Add.
To add devices, select \preferences > \uicontrol Devices >
\uicontrol Devices > \uicontrol Add.
For more information, see \l{Develop for Devices}.
For more information, see \l{Manage Kits}{How To: Manage Kits} and
\l{Develop for Devices}{How To: Develop for Devices}.
\section1 Changing Keyboard Shortcuts
You can use \QC with your favorite keyboard shortcuts.
To view and edit all keyboard shortcuts defined in \QC, select
\preferences >
\uicontrol Environment >
\uicontrol Keyboard. For more information, see \l{Keyboard Shortcuts}.
To view and edit all keyboard shortcuts defined in \QC, go to \preferences >
\uicontrol Environment > \uicontrol Keyboard. For more information, see
\l{Keyboard Shortcuts}.
\section1 Changing Color Schemes
Themes enable you to customize the appearance of the \QC UI: widgets,
colors, and icons.
Themes set the appearance of the \QC UI: widgets, colors, and icons.
To switch themes, select \preferences > \uicontrol Environment >
\uicontrol Interface, and then select a theme in the \uicontrol Theme field.
To switch themes, go to \preferences > \uicontrol Environment >
\uicontrol Interface and select a theme in \uicontrol Theme.
You can use the \QC text and code editors with your favorite color scheme
that defines how to highlight code elements and which background color to
use. You can select one of the predefined color schemes or create custom
ones. The color schemes apply to highlighting C++ files, QML files, and
generic files.
Use the \QC text and code editors with your favorite color scheme that sets
highlighting of code elements and the background color. Select one of the
predefined color schemes or create custom ones. The color schemes apply to
highlighting C++ files, QML files, and generic files.
To change the color scheme, select \preferences >
To change the color scheme, go to \preferences >
\uicontrol {Text Editor} > \uicontrol {Font & Colors}.
For more information, see \l{Change editor colors}.
@@ -108,7 +99,7 @@
highlighting engine for Kate syntax definitions. \QC comes with most of
the commonly used syntax files, and you can download additional files.
To download and use highlight definition files, select \preferences >
To download and use highlight definition files, go to \preferences >
\uicontrol {Text Editor} > \uicontrol {Generic Highlighter}.
For more information, see \l{Download highlight definitions}.
@@ -117,10 +108,10 @@
As you write code, \QC suggests properties, IDs, and code snippets to
complete the code. It lists context-sensitive suggestions for
the statement currently under your cursor. You can add, modify, and remove
the statement currently under your cursor. Add, modify, and remove
snippets in the snippet editor.
To open the snippet editor, select \preferences >
To open the snippet editor, go to \preferences >
\uicontrol {Text Editor} > \uicontrol Snippets.
For more information, see \l{Snippets}.
@@ -131,8 +122,7 @@
to configure the version control in any special way to make it work with
\QC.
However, some configuration options are available and you can set them in
\preferences >
However, you can set some configuration options in \preferences >
\uicontrol {Version Control} > \uicontrol General.
For more information about the supported functions, see
@@ -144,13 +134,15 @@
You can \l{Enable and disable plugins}{enable} disabled plugins if you
need them and disable plugins you don't need.
You can \l{Install plugins}{download and install} more plugins from
\l{Install plugins}{Download and install} more plugins from
\l{https://marketplace.qt.io/}{Qt Marketplace} or some
other source, such as \l{https://github.com/}{GitHub}.
To enable and disable plugins, select \uicontrol Help >
To enable and disable plugins, go to \uicontrol Help >
\uicontrol {About Plugins}.
To install plugins, select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {Install Plugins}.
To install plugins, go to \uicontrol Help > \uicontrol {About Plugins} and
select \uicontrol {Install Plugins}.
\sa {Install \QC}, {Reset \QC settings}, {Preferences}
*/

View File

@@ -238,7 +238,7 @@
{ "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" },
{ "key": "Base", "value": "%{JS: value('BaseCB') === '' ? value('BaseEdit') : value('BaseCB')}" },
{ "key": "isQObject", "value": "%{JS: (value('Base') === 'QObject' || value('Base') === 'QWidget' || value('Base') === 'QMainWindow' || value('Base') === 'QQuickItem' ) ? 'true' : 'false'}" },
{ "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('Class'), Util.suffix(value('HdrFileName'))}" },
{ "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" },
{ "key": "SharedDataInit", "value": "%{JS: value('IncludeQSharedData') ? 'data(new %{CN}Data)' : '' }" }
],
\endcode

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (C) 2020 The Qt Company Ltd.
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
# import the print function which is used in python 3.x
@@ -295,12 +295,15 @@ def package_qtcreator(args, paths):
'*'],
paths.debug_install)
if common.is_windows_platform():
common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads,
# use -mf=off to avoid usage of the ARM executable compression filter,
# which cannot be extracted by the p7zip version on the machine doing
# the repository builds
common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads, '-mf=off',
os.path.join(paths.result, 'wininterrupt' + args.zip_infix + '.7z'),
'*'],
paths.wininterrupt_install)
if not args.no_cdb:
common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads,
common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads, '-mf=off',
os.path.join(paths.result, 'qtcreatorcdbext' + args.zip_infix + '.7z'),
'*'],
paths.qtcreatorcdbext_install)

View File

@@ -23,8 +23,8 @@
{ "key": "ObjectHdr", "value": "%{JS: Cpp.classToFileName(value('ObjectName'), Util.preferredSuffix('text/x-c++hdr'))}" },
{ "key": "ObjectQml", "value": "%{JS: Util.fileName(value('ObjectName') + 'Controls', 'qml')}" },
{ "key": "PluginName", "value": "%{JS: value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1) + 'Plugin' }" },
{ "key": "PLUGINGUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('PluginBaseFileName'), Util.preferredSuffix('text/x-c++hdr'))}" },
{ "key": "OBJECTGUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('ObjectName'), Util.preferredSuffix('text/x-c++hdr'))}" },
{ "key": "PLUGINGUARD", "value": "%{JS: Cpp.headerGuard(value('PluginHdr'))}" },
{ "key": "OBJECTGUARD", "value": "%{JS: Cpp.headerGuard(value('ObjectHdr'))}" },
{ "key": "IsQt6", "value": "%{JS: value('QtVersion').IsQt6}" },
{ "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" },
{ "key": "QtQuickFeature", "value": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQt.6.2' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" },

View File

@@ -289,7 +289,7 @@ void WorkspaceView::keyPressEvent(QKeyEvent *event)
void WorkspaceView::dropEvent(QDropEvent *event)
{
const QModelIndex dropIndex = indexAt(event->pos());
const QModelIndex dropIndex = indexAt(event->position().toPoint());
const DropIndicatorPosition dropIndicator = dropIndicatorPosition();
const auto droppedWorkspaces = selectedWorkspaces();

View File

@@ -38,7 +38,7 @@ private:
InvokerBase(const InvokerBase &); // Unimplemented.
template <class T> const char *typeName()
{
return QMetaType::typeName(qMetaTypeId<T>());
return QMetaType(qMetaTypeId<T>()).name();
}
QObject *target;
QGenericArgument arg[10];

View File

@@ -112,7 +112,7 @@ void DiagramView::dropEvent(QDropEvent *event)
if (diagramSceneController->isAddingAllowed(Uid(QUuid(key)),
m_diagramSceneModel->diagram())) {
diagramSceneController->addExistingModelElement(Uid(QUuid(key)),
mapToScene(event->pos()),
mapToScene(event->position().toPoint()),
m_diagramSceneModel->diagram());
}
}
@@ -126,10 +126,10 @@ void DiagramView::dropEvent(QDropEvent *event)
QString stereotype;
dataStream >> newElementId >> name >> stereotype;
if (!newElementId.isEmpty()) {
QPointF pos = mapToScene(event->pos());
QPointF pos = mapToScene(event->position().toPoint());
diagramSceneController->dropNewElement(
newElementId, name, stereotype, m_diagramSceneModel->findTopmostElement(pos),
pos, m_diagramSceneModel->diagram(), event->pos(), size());
pos, m_diagramSceneModel->diagram(), event->position().toPoint(), size());
}
}
event->accept();

View File

@@ -184,7 +184,7 @@ void ModelTreeView::dragMoveEvent(QDragMoveEvent *event)
{
QTreeView::dragMoveEvent(event);
bool accept = false;
QModelIndex dropIndex = indexAt(event->pos());
QModelIndex dropIndex = indexAt(event->position().toPoint());
QModelIndex dropSourceModelIndex = m_sortedTreeModel->mapToSource(dropIndex);
if (dropSourceModelIndex.isValid()) {
TreeModel *treeModel = m_sortedTreeModel->treeModel();
@@ -215,7 +215,7 @@ void ModelTreeView::dropEvent(QDropEvent *event)
bool accept = false;
event->setDropAction(Qt::MoveAction);
if (event->mimeData()->hasFormat("text/model-elements")) {
QModelIndex dropIndex = indexAt(event->pos());
QModelIndex dropIndex = indexAt(event->position().toPoint());
QModelIndex dropSourceModelIndex = m_sortedTreeModel->mapToSource(dropIndex);
if (dropSourceModelIndex.isValid()) {
TreeModel *treeModel = m_sortedTreeModel->treeModel();

View File

@@ -1,8 +1,11 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "barrier.h"
QT_BEGIN_NAMESPACE
namespace Tasking {
// That's cut down qtcassert.{c,h} to avoid the dependency.
@@ -47,3 +50,5 @@ void Barrier::stopWithResult(DoneResult result)
}
} // namespace Tasking
QT_END_NAMESPACE

View File

@@ -1,12 +1,16 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#ifndef TASKING_BARRIER_H
#define TASKING_BARRIER_H
#include "tasking_global.h"
#include "tasktree.h"
QT_BEGIN_NAMESPACE
namespace Tasking {
class TASKING_EXPORT Barrier final : public QObject
@@ -91,3 +95,7 @@ GroupItem waitForBarrierTask(const MultiBarrier<Limit> &sharedBarrier)
}
} // namespace Tasking
QT_END_NAMESPACE
#endif // TASKING_BARRIER_H

View File

@@ -1,12 +1,16 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#ifndef TASKING_CONCURRENTCALL_H
#define TASKING_CONCURRENTCALL_H
#include "tasktree.h"
#include <QtConcurrent/QtConcurrent>
QT_BEGIN_NAMESPACE
namespace Tasking {
// This class introduces the dependency to Qt::Concurrent, otherwise Tasking namespace
@@ -98,3 +102,7 @@ template <typename T>
using ConcurrentCallTask = CustomTask<ConcurrentCallTaskAdapter<T>>;
} // namespace Tasking
QT_END_NAMESPACE
#endif // TASKING_CONCURRENTCALL_H

View File

@@ -1,10 +1,13 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "networkquery.h"
#include <QtNetwork/QNetworkAccessManager>
QT_BEGIN_NAMESPACE
namespace Tasking {
void NetworkQuery::start()
@@ -51,3 +54,5 @@ NetworkQuery::~NetworkQuery()
}
} // namespace Tasking
QT_END_NAMESPACE

View File

@@ -1,7 +1,9 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#pragma once
#ifndef TASKING_NETWORKQUERY_H
#define TASKING_NETWORKQUERY_H
#include "tasking_global.h"
@@ -14,7 +16,6 @@
QT_BEGIN_NAMESPACE
class QNetworkAccessManager;
QT_END_NAMESPACE
namespace Tasking {
@@ -59,3 +60,7 @@ public:
using NetworkQueryTask = CustomTask<NetworkQueryTaskAdapter>;
} // namespace Tasking
QT_END_NAMESPACE
#endif // TASKING_NETWORKQUERY_H

View File

@@ -1,4 +1,5 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qprocesstask.h"
@@ -10,6 +11,10 @@
#include <QtCore/QTimer>
#include <QtCore/QWaitCondition>
QT_BEGIN_NAMESPACE
#if QT_CONFIG(process)
namespace Tasking {
class ProcessReaperPrivate;
@@ -262,4 +267,13 @@ void QProcessDeleter::operator()(QProcess *process)
} // namespace Tasking
#endif // QT_CONFIG(process)
QT_END_NAMESPACE
#if QT_CONFIG(process)
#include "qprocesstask.moc"
#endif // QT_CONFIG(process)

View File

@@ -1,7 +1,9 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#ifndef TASKING_QPROCESSTASK_H
#define TASKING_QPROCESSTASK_H
#include "tasking_global.h"
@@ -9,6 +11,10 @@
#include <QtCore/QProcess>
QT_BEGIN_NAMESPACE
#if QT_CONFIG(process)
namespace Tasking {
// Deleting a running QProcess may block the caller thread up to 30 seconds and issue warnings.
@@ -64,3 +70,9 @@ private:
using QProcessTask = CustomTask<QProcessAdapter>;
} // namespace Tasking
#endif // QT_CONFIG(process)
QT_END_NAMESPACE
#endif // TASKING_QPROCESSTASK_H

View File

@@ -1,10 +1,13 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#ifndef TASKING_GLOBAL_H
#define TASKING_GLOBAL_H
#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
#if defined(TASKING_LIBRARY)
# define TASKING_EXPORT Q_DECL_EXPORT
#elif defined(TASKING_STATIC_LIBRARY)
@@ -12,3 +15,7 @@
#else
# define TASKING_EXPORT Q_DECL_IMPORT
#endif
QT_END_NAMESPACE
#endif // TASKING_GLOBAL_H

View File

@@ -1,4 +1,5 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "tasktree.h"
@@ -19,6 +20,8 @@
using namespace std::chrono;
QT_BEGIN_NAMESPACE
namespace Tasking {
// That's cut down qtcassert.{c,h} to avoid the dependency.
@@ -3415,3 +3418,5 @@ void TimeoutTaskAdapter::start()
*/
} // namespace Tasking
QT_END_NAMESPACE

View File

@@ -1,7 +1,9 @@
// Copyright (C) 2023 The Qt Company Ltd.
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#ifndef TASKING_TASKTREE_H
#define TASKING_TASKTREE_H
#include "tasking_global.h"
@@ -13,7 +15,6 @@
QT_BEGIN_NAMESPACE
template <class T>
class QFuture;
QT_END_NAMESPACE
namespace Tasking {
@@ -41,7 +42,7 @@ enum class WorkflowPolicy
FinishAllAndSuccess, // 4 - Reports success after all children finished.
FinishAllAndError // 5 - Reports error after all children finished.
};
Q_ENUM_NS(WorkflowPolicy);
Q_ENUM_NS(WorkflowPolicy)
enum class SetupResult
{
@@ -49,14 +50,14 @@ enum class SetupResult
StopWithSuccess,
StopWithError
};
Q_ENUM_NS(SetupResult);
Q_ENUM_NS(SetupResult)
enum class DoneResult
{
Success,
Error
};
Q_ENUM_NS(DoneResult);
Q_ENUM_NS(DoneResult)
enum class DoneWith
{
@@ -64,7 +65,7 @@ enum class DoneWith
Error,
Cancel
};
Q_ENUM_NS(DoneWith);
Q_ENUM_NS(DoneWith)
enum class CallDoneIf
{
@@ -72,7 +73,7 @@ enum class CallDoneIf
Success,
Error
};
Q_ENUM_NS(CallDoneIf);
Q_ENUM_NS(CallDoneIf)
TASKING_EXPORT DoneResult toDoneResult(bool success);
@@ -624,3 +625,7 @@ using TaskTreeTask = CustomTask<TaskTreeTaskAdapter>;
using TimeoutTask = CustomTask<TimeoutTaskAdapter>;
} // namespace Tasking
QT_END_NAMESPACE
#endif // TASKING_TASKTREE_H

View File

@@ -1,3 +1,4 @@
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
@@ -5,6 +6,8 @@
#include "tasktree.h"
QT_BEGIN_NAMESPACE
namespace Tasking {
TaskTreeRunner::~TaskTreeRunner() = default;
@@ -38,3 +41,5 @@ void TaskTreeRunner::reset()
}
} // namespace Tasking
QT_END_NAMESPACE

View File

@@ -1,13 +1,17 @@
// Copyright (C) 2024 Jarek Kobus
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#ifndef TASKING_TASKTREERUNNER_H
#define TASKING_TASKTREERUNNER_H
#include "tasking_global.h"
#include "tasktree.h"
#include <QtCore/QObject>
QT_BEGIN_NAMESPACE
namespace Tasking {
class TASKING_EXPORT TaskTreeRunner : public QObject
@@ -42,3 +46,7 @@ private:
};
} // namespace Tasking
QT_END_NAMESPACE
#endif // TASKING_TASKTREERUNNER_H

View File

@@ -10,6 +10,7 @@
#include "guard.h"
#include "iconbutton.h"
#include "layoutbuilder.h"
#include "macroexpander.h"
#include "passworddialog.h"
#include "pathchooser.h"
#include "pathlisteditor.h"
@@ -95,6 +96,7 @@ public:
BaseAspect::DataCloner m_dataCloner;
QList<BaseAspect::DataExtractor> m_dataExtractors;
MacroExpander *m_expander = globalMacroExpander();
QUndoStack *m_undoStack = nullptr;
};
@@ -724,6 +726,27 @@ QVariant BaseAspect::fromSettingsValue(const QVariant &val) const
return d->m_fromSettings ? d->m_fromSettings(val) : val;
}
void BaseAspect::setMacroExpander(MacroExpander *expander)
{
d->m_expander = expander;
}
MacroExpander *BaseAspect::macroExpander() const
{
return d->m_expander;
}
void BaseAspect::addMacroExpansion(QWidget *w)
{
if (!d->m_expander)
return;
const auto chooser = new VariableChooser(w);
chooser->addSupportedWidget(w);
chooser->addMacroExpanderProvider([this] { return d->m_expander; });
if (auto pathChooser = qobject_cast<PathChooser *>(w))
pathChooser->setMacroExpander(d->m_expander);
}
namespace Internal {
class BoolAspectPrivate
@@ -887,7 +910,6 @@ public:
Qt::TextElideMode m_elideMode = Qt::ElideNone;
QString m_placeHolderText;
Key m_historyCompleterKey;
MacroExpanderProvider m_expanderProvider;
StringAspect::ValueAcceptor m_valueAcceptor;
std::optional<FancyLineEdit::ValidationFunction> m_validator;
@@ -1119,16 +1141,6 @@ void StringAspect::setAcceptRichText(bool acceptRichText)
emit acceptRichTextChanged(acceptRichText);
}
void StringAspect::setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider)
{
d->m_expanderProvider = expanderProvider;
}
void StringAspect::setUseGlobalMacroExpander()
{
d->m_expanderProvider = &globalMacroExpander;
}
void StringAspect::setUseResetButton()
{
d->m_useResetButton = true;
@@ -1149,14 +1161,6 @@ void StringAspect::addToLayout(Layout &parent)
{
d->m_checkerImpl.addToLayoutFirst(parent);
const auto useMacroExpander = [this](QWidget *w) {
if (!d->m_expanderProvider)
return;
const auto chooser = new VariableChooser(w);
chooser->addSupportedWidget(w);
chooser->addMacroExpanderProvider(d->m_expanderProvider);
};
const QString displayedString = d->m_displayFilter ? d->m_displayFilter(volatileValue())
: volatileValue();
@@ -1164,6 +1168,7 @@ void StringAspect::addToLayout(Layout &parent)
case PasswordLineEditDisplay:
case LineEditDisplay: {
auto lineEditDisplay = createSubWidget<FancyLineEdit>();
addMacroExpansion(lineEditDisplay);
lineEditDisplay->setPlaceholderText(d->m_placeHolderText);
if (!d->m_historyCompleterKey.isEmpty())
lineEditDisplay->setHistoryCompleter(d->m_historyCompleterKey);
@@ -1197,7 +1202,6 @@ void StringAspect::addToLayout(Layout &parent)
}
addLabeledItem(parent, lineEditDisplay);
useMacroExpander(lineEditDisplay);
if (d->m_useResetButton) {
auto resetButton = createSubWidget<QPushButton>(Tr::tr("Reset"));
resetButton->setEnabled(lineEditDisplay->text() != defaultValue());
@@ -1255,6 +1259,7 @@ void StringAspect::addToLayout(Layout &parent)
}
case TextEditDisplay: {
auto textEditDisplay = createSubWidget<QTextEdit>();
addMacroExpansion(textEditDisplay);
textEditDisplay->setPlaceholderText(d->m_placeHolderText);
textEditDisplay->setUndoRedoEnabled(false);
textEditDisplay->setAcceptRichText(d->m_acceptRichText);
@@ -1273,7 +1278,6 @@ void StringAspect::addToLayout(Layout &parent)
}
addLabeledItem(parent, textEditDisplay);
useMacroExpander(textEditDisplay);
bufferToGui();
connect(this,
&StringAspect::acceptRichTextChanged,
@@ -1323,8 +1327,10 @@ void StringAspect::addToLayout(Layout &parent)
QString StringAspect::expandedValue() const
{
if (!m_internal.isEmpty() && d->m_expanderProvider)
return d->m_expanderProvider()->expand(m_internal);
if (!m_internal.isEmpty()) {
if (auto expander = macroExpander())
return expander->expand(m_internal);
}
return m_internal;
}
@@ -1406,7 +1412,6 @@ public:
PathChooser::Kind m_expectedKind = PathChooser::File;
Environment m_environment;
QPointer<PathChooser> m_pathChooserDisplay;
MacroExpanderProvider m_expanderProvider;
FilePath m_baseFileName;
StringAspect::ValueAcceptor m_valueAcceptor;
std::optional<FancyLineEdit::ValidationFunction> m_validator;
@@ -1453,8 +1458,10 @@ FilePath FilePathAspect::operator()() const
FilePath FilePathAspect::expandedValue() const
{
const auto value = TypedAspect::value();
if (!value.isEmpty() && d->m_expanderProvider)
return FilePath::fromUserInput(d->m_expanderProvider()->expand(value));
if (!value.isEmpty()) {
if (auto expander = macroExpander())
return FilePath::fromUserInput(expander->expand(value));
}
return FilePath::fromUserInput(value);
}
@@ -1586,17 +1593,10 @@ void FilePathAspect::addToLayout(Layouting::Layout &parent)
{
d->m_checkerImpl.addToLayoutFirst(parent);
const auto useMacroExpander = [this](QWidget *w) {
if (!d->m_expanderProvider)
return;
const auto chooser = new VariableChooser(w);
chooser->addSupportedWidget(w);
chooser->addMacroExpanderProvider(d->m_expanderProvider);
};
const QString displayedString = d->m_displayFilter ? d->m_displayFilter(value()) : value();
d->m_pathChooserDisplay = createSubWidget<PathChooser>();
addMacroExpansion(d->m_pathChooserDisplay->lineEdit());
d->m_pathChooserDisplay->setExpectedKind(d->m_expectedKind);
if (!d->m_historyCompleterKey.isEmpty())
d->m_pathChooserDisplay->setHistoryCompleter(d->m_historyCompleterKey);
@@ -1621,7 +1621,6 @@ void FilePathAspect::addToLayout(Layouting::Layout &parent)
d->m_pathChooserDisplay->lineEdit()->setPlaceholderText(d->m_placeHolderText);
d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data());
addLabeledItem(parent, d->m_pathChooserDisplay);
useMacroExpander(d->m_pathChooserDisplay->lineEdit());
connect(d->m_pathChooserDisplay, &PathChooser::validChanged, this, &FilePathAspect::validChanged);
bufferToGui();
if (isAutoApply() && d->m_autoApplyOnEditingFinished) {
@@ -1765,11 +1764,6 @@ void FilePathAspect::setHistoryCompleter(const Key &historyCompleterKey)
d->m_pathChooserDisplay->setHistoryCompleter(historyCompleterKey);
}
void FilePathAspect::setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider)
{
d->m_expanderProvider = expanderProvider;
}
void FilePathAspect::validateInput()
{
if (d->m_pathChooserDisplay)
@@ -3237,6 +3231,14 @@ void AspectContainer::setUndoStack(QUndoStack *undoStack)
aspect->setUndoStack(undoStack);
}
void AspectContainer::setMacroExpander(MacroExpander *expander)
{
BaseAspect::setMacroExpander(expander);
for (BaseAspect *aspect : std::as_const(d->m_items))
aspect->setMacroExpander(expander);
}
bool AspectContainer::equals(const AspectContainer &other) const
{
// FIXME: Expensive, but should not really be needed in a fully aspectified world.

View File

@@ -7,7 +7,6 @@
#include "guiutils.h"
#include "id.h"
#include "infolabel.h"
#include "macroexpander.h"
#include "pathchooser.h"
#include "qtcsettings.h"
#include "store.h"
@@ -36,6 +35,7 @@ namespace Utils {
class AspectContainer;
class BoolAspect;
class CheckableDecider;
class MacroExpander;
namespace Internal {
class AspectContainerPrivate;
@@ -202,6 +202,9 @@ public:
// This is expensive. Do not use without good reason
void writeToSettingsImmediatly() const;
void setMacroExpander(MacroExpander *expander);
MacroExpander *macroExpander() const;
signals:
void changed();
void volatileValueChanged();
@@ -219,6 +222,8 @@ protected:
virtual void handleGuiChanged();
void addMacroExpansion(QWidget *w);
QLabel *createLabel();
void addLabeledItem(Layouting::Layout &parent, QWidget *widget);
@@ -607,8 +612,6 @@ public:
void setPlaceHolderText(const QString &placeHolderText);
void setHistoryCompleter(const Key &historyCompleterKey);
void setAcceptRichText(bool acceptRichText);
void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider);
void setUseGlobalMacroExpander();
void setUseResetButton();
void setValidationFunction(const FancyLineEdit::ValidationFunction &validator);
void setAutoApplyOnEditingFinished(bool applyOnEditingFinished);
@@ -685,7 +688,6 @@ public:
void setValidationFunction(const FancyLineEdit::ValidationFunction &validator);
void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter);
void setHistoryCompleter(const Key &historyCompleterKey);
void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider);
void setShowToolTipOnLabel(bool show);
void setAutoApplyOnEditingFinished(bool applyOnEditingFinished);
@@ -975,6 +977,8 @@ public:
bool isDirty() override;
void setUndoStack(QUndoStack *undoStack) override;
void setMacroExpander(MacroExpander *expander);
template <typename T> T *aspect() const
{
for (BaseAspect *aspect : aspects())

View File

@@ -108,7 +108,7 @@ bool DropSupport::eventFilter(QObject *obj, QEvent *event)
de->acceptProposedAction();
bool needToScheduleEmit = m_files.isEmpty();
m_files.append(tempFiles);
m_dropPos = de->pos();
m_dropPos = de->position().toPoint();
if (needToScheduleEmit) { // otherwise we already have a timer pending
// Delay the actual drop, to avoid conflict between
// actions that happen when opening files, and actions that the item views do
@@ -122,7 +122,7 @@ bool DropSupport::eventFilter(QObject *obj, QEvent *event)
accepted = true;
bool needToScheduleEmit = m_values.isEmpty();
m_values.append(fileDropMimeData->values());
m_dropPos = de->pos();
m_dropPos = de->position().toPoint();
if (needToScheduleEmit)
QTimer::singleShot(100, this, &DropSupport::emitValuesDropped);
}

View File

@@ -293,6 +293,26 @@ QString FilePath::toString() const
return scheme() + "://" + encodedHost() + pathView();
}
bool FilePath::equals(const FilePath &first, const FilePath &second, Qt::CaseSensitivity cs)
{
if (first.m_hash != 0 && second.m_hash != 0 && first.m_hash != second.m_hash)
return false;
return first.pathView().compare(second.pathView(), cs) == 0
&& first.host() == second.host()
&& first.scheme() == second.scheme();
}
/*!
* Returns true if the two file paths compare equal case-sensitively.
* This is relevant on semi-case sensitive systems like Windows with NTFS.
* @see QTCREATORBUG-30846
*/
bool FilePath::equalsCaseSensitive(const FilePath &other) const
{
return equals(*this, other, Qt::CaseSensitive);
}
/*!
Returns a QString for passing on to QString based APIs.
@@ -2354,12 +2374,7 @@ DeviceFileHooks &DeviceFileHooks::instance()
QTCREATOR_UTILS_EXPORT bool operator==(const FilePath &first, const FilePath &second)
{
if (first.m_hash != 0 && second.m_hash != 0 && first.m_hash != second.m_hash)
return false;
return first.pathView().compare(second.pathView(), first.caseSensitivity()) == 0
&& first.host() == second.host()
&& first.scheme() == second.scheme();
return FilePath::equals(first, second, first.caseSensitivity());
}
QTCREATOR_UTILS_EXPORT bool operator!=(const FilePath &first, const FilePath &second)

View File

@@ -268,6 +268,8 @@ public:
// FIXME: Avoid. See toSettings, toVariant, toUserOutput, toFSPathString, path, nativePath.
QString toString() const;
bool equalsCaseSensitive(const FilePath &other) const;
private:
// These are needed.
QTCREATOR_UTILS_EXPORT friend bool operator==(const FilePath &first, const FilePath &second);
@@ -282,6 +284,8 @@ private:
QTCREATOR_UTILS_EXPORT friend QDebug operator<<(QDebug dbg, const FilePath &c);
static bool equals(const FilePath &first, const FilePath &second, Qt::CaseSensitivity cs);
// Implementation details. May change.
friend class ::tst_fileutils;
void setPath(QStringView path);

View File

@@ -232,10 +232,17 @@ LayoutItem::LayoutItem() = default;
LayoutItem::~LayoutItem() = default;
LayoutItem::LayoutItem(const LayoutModifier &inner)
{
ownerModifier = inner;
}
LayoutItem::LayoutItem(QLayout *l)
: layout(l), empty(!l)
{}
LayoutItem::LayoutItem(QWidget *w)
: widget(w), empty(!w)
{}
LayoutItem::LayoutItem(const QString &t)
: text(t), empty(t.isEmpty())
{}
/*!
\fn template <class T> LayoutItem(const T &t)
@@ -428,31 +435,23 @@ void addToWidget(Widget *widget, const Layout &layout)
void addToLayout(Layout *layout, const Widget &inner)
{
LayoutItem item;
item.widget = access(&inner);
layout->addLayoutItem(item);
layout->addLayoutItem(access(&inner));
}
void addToLayout(Layout *layout, QWidget *inner)
{
LayoutItem item;
item.widget = inner;
layout->addLayoutItem(item);
layout->addLayoutItem(inner);
}
void addToLayout(Layout *layout, QLayout *inner)
{
LayoutItem item;
item.layout = inner;
layout->addLayoutItem(item);
layout->addLayoutItem(inner);
}
void addToLayout(Layout *layout, const Layout &inner)
{
inner.flush_();
LayoutItem item;
item.layout = access(&inner);
layout->addLayoutItem(item);
layout->addLayoutItem(access(&inner));
}
void addToLayout(Layout *layout, const LayoutModifier &inner)
@@ -462,9 +461,7 @@ void addToLayout(Layout *layout, const LayoutModifier &inner)
void addToLayout(Layout *layout, const QString &inner)
{
LayoutItem item;
item.text = inner;
layout->addLayoutItem(item);
layout->addLayoutItem(inner);
}
void empty(Layout *layout)

View File

@@ -41,13 +41,12 @@ namespace Layouting {
class NestId {};
template <typename T1, typename T2>
template <typename Id, typename Arg>
class IdAndArg
{
public:
IdAndArg(const T1 &id, const T2 &arg) : id(id), arg(arg) {}
const T1 id;
const T2 arg; // FIXME: Could be const &, but this would currently break bindTo().
IdAndArg(Id, const Arg &arg) : arg(arg) {}
const Arg arg; // FIXME: Could be const &, but this would currently break bindTo().
};
template<typename T1, typename T2>
@@ -107,7 +106,7 @@ public:
template <typename Id, typename Arg>
BuilderItem(IdAndArg<Id, Arg> && idarg)
{
apply = [&idarg](X *x) { doit(x, idarg.id, idarg.arg); };
apply = [&idarg](X *x) { doit(x, Id{}, idarg.arg); };
}
std::function<void(X *)> apply;
@@ -143,17 +142,15 @@ public:
class FlowLayout;
class Layout;
using LayoutModifier = std::function<void(Layout *)>;
// using LayoutModifier = void(*)(Layout *);
class QTCREATOR_UTILS_EXPORT LayoutItem
{
public:
~LayoutItem();
LayoutItem();
LayoutItem(QLayout *l) : layout(l) {}
LayoutItem(QWidget *w) : widget(w) {}
LayoutItem(const QString &t) : text(t) {}
LayoutItem(const LayoutModifier &inner);
LayoutItem(QLayout *l);
LayoutItem(QWidget *w);
LayoutItem(const QString &t);
QString text;
QLayout *layout = nullptr;
@@ -162,8 +159,6 @@ public:
int spanCols = 1;
int spanRows = 1;
bool empty = false;
LayoutModifier ownerModifier;
//Qt::Alignment align = {};
};
class QTCREATOR_UTILS_EXPORT Layout : public Object

View File

@@ -5,7 +5,6 @@
#include "utils_global.h"
#include <QCoreApplication>
#include <QList>
#include <functional>

View File

@@ -1,10 +1,34 @@
cmake_minimum_required(VERSION 3.16)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake")
project(AppStatisticMonitor)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Qt6 COMPONENTS Charts QUIET)
if (NOT QT_CREATOR_API_DEFINED)
# standalone build
set(DESTINATION DESTINATION .)
include(QtCreatorIDEBranding)
include(QtCreatorAPI)
qtc_handle_compiler_cache_support()
find_package(QtCreator COMPONENTS Core ProjectExplorer Utils REQUIRED)
endif()
add_qtc_plugin(AppStatisticsMonitor
CONDITION TARGET Qt6::Charts
DEPENDS Qt6::Charts
SKIP_TRANSLATION
PLUGIN_DEPENDS Core ProjectExplorer
DEPENDS Qt6::Charts QtCreator::Utils
PLUGIN_DEPENDS QtCreator::Core QtCreator::ProjectExplorer
SOURCES
appstatisticsmonitorplugin.cpp
chart.cpp chart.h

View File

@@ -15,6 +15,11 @@
#include <unistd.h>
#endif
#ifdef Q_OS_WIN
#include <windows.h>
#include <psapi.h>
#endif
using namespace Utils;
namespace AppStatisticsMonitor::Internal {
@@ -175,35 +180,71 @@ class WindowsDataProvider : public IDataProvider
public:
WindowsDataProvider(qint64 pid, QObject *parent = nullptr)
: IDataProvider(pid, parent)
{}
double getMemoryConsumption() { return 0; }
double getCpuConsumption() { return 0; }
#if 0
double getMemoryConsumptionWindows(qint64 pid)
{
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid);
if (hProcess == NULL) {
std::cerr << "Failed to open process. Error code: " << GetLastError() << std::endl;
return 1;
}
MEMORYSTATUSEX memoryStatus;
memoryStatus.dwLength = sizeof(memoryStatus);
GlobalMemoryStatusEx(&memoryStatus);
PROCESS_MEMORY_COUNTERS_EX pmc;
if (!GetProcessMemoryInfo(hProcess, (PROCESS_MEMORY_COUNTERS*)&pmc, sizeof(pmc))) {
std::cerr << "Failed to retrieve process memory information. Error code: " << GetLastError() << std::endl;
CloseHandle(hProcess);
return 1;
}
std::cout << "Process ID: " << pid << std::endl;
std::cout << "Memory consumption: " << pmc.PrivateUsage << " bytes" << std::endl;
CloseHandle(hProcess);
return pmc.PrivateUsage;
m_totalMemory = memoryStatus.ullTotalPhys;
}
#endif
double getMemoryConsumption()
{
HANDLE process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, m_pid);
PROCESS_MEMORY_COUNTERS pmc;
SIZE_T memoryUsed = 0;
if (GetProcessMemoryInfo(process, &pmc, sizeof(pmc))) {
memoryUsed = pmc.WorkingSetSize;
// Can be used in the future for the process lifetime statistics
//double memoryUsedMB = static_cast<double>(memoryUsed) / (1024.0 * 1024.0);
}
CloseHandle(process);
return static_cast<double>(memoryUsed) / static_cast<double>(m_totalMemory) * 100.0;
}
double getCpuConsumption()
{
ULARGE_INTEGER sysKernel, sysUser, procKernel, procUser;
HANDLE process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, m_pid);
FILETIME creationTime, exitTime, kernelTime, userTime;
GetProcessTimes(process, &creationTime, &exitTime, &kernelTime, &userTime);
procKernel.LowPart = kernelTime.dwLowDateTime;
procKernel.HighPart = kernelTime.dwHighDateTime;
procUser.LowPart = userTime.dwLowDateTime;
procUser.HighPart = userTime.dwHighDateTime;
SYSTEMTIME sysTime;
GetSystemTime(&sysTime);
SystemTimeToFileTime(&sysTime, &kernelTime);
SystemTimeToFileTime(&sysTime, &userTime);
sysKernel.LowPart = kernelTime.dwLowDateTime;
sysKernel.HighPart = kernelTime.dwHighDateTime;
sysUser.LowPart = userTime.dwLowDateTime;
sysUser.HighPart = userTime.dwHighDateTime;
const double sysElapsedTime = sysKernel.QuadPart + sysUser.QuadPart
- m_lastSysKernel.QuadPart - m_lastSysUser.QuadPart;
const double procElapsedTime = procKernel.QuadPart + procUser.QuadPart
- m_lastProcKernel.QuadPart - m_lastProcUser.QuadPart;
const double cpuUsagePercent = (procElapsedTime / sysElapsedTime) * 100.0;
m_lastProcKernel = procKernel;
m_lastProcUser = procUser;
m_lastSysKernel = sysKernel;
m_lastSysUser = sysUser;
CloseHandle(process);
return cpuUsagePercent;
}
private:
ULARGE_INTEGER m_lastSysKernel = {{0, 0}}, m_lastSysUser = {{0, 0}},
m_lastProcKernel = {{0, 0}}, m_lastProcUser = {{0, 0}};
DWORDLONG m_totalMemory = 0;
};
#endif

View File

@@ -17,7 +17,7 @@
"Description" : "Develop applications for bare metal devices",
"LongDescription" : [
"Adds a target for bare metal development.",
"Connect devices with USB or WLAN to run, debug, and analyze applications built for them.",
"Connect devices with debug server providers to run, debug, and analyze applications built for them.",
"You also need:",
"- A toolchain for bare metal development"
],

View File

@@ -147,8 +147,8 @@ void BazaarClient::annotate(const Utils::FilePath &workingDir, const QString &fi
bool BazaarClient::isVcsDirectory(const FilePath &filePath) const
{
return filePath.isDir()
&& !filePath.fileName().compare(Constants::BAZAARREPO, HostOsInfo::fileNameCaseSensitivity());
return !filePath.fileName().compare(Constants::BAZAARREPO, HostOsInfo::fileNameCaseSensitivity())
&& filePath.isDir();
}
FilePath BazaarClient::findTopLevelForFile(const FilePath &file) const

View File

@@ -17,7 +17,7 @@
"Category" : "Device Support",
"Description" : "Develop applications for Boot to Qt devices",
"LongDescription" : [
"Connect devices with USB or WLAN to run, debug, and analyze applications built for them.",
"Connect devices with a USB cable, or a wired or wireless connection, depending on the device to run, debug, and analyze applications built for them.",
"You also need:",
"- Boot to Qt",
"- Build tools and other dependencies related to the development host"

View File

@@ -961,12 +961,8 @@ const clang::format::FormatStyle &ClangFormatBaseIndenterPrivate::styleForFile()
return m_cachedStyle.style;
}
llvm::Expected<clang::format::FormatStyle> styleFromProjectFolder
= clang::format::getStyle("file",
m_fileName->toFSPathString().toStdString(),
"none",
"",
&llvmFileSystemAdapter);
llvm::Expected<clang::format::FormatStyle> styleFromProjectFolder = clang::format::getStyle(
"file", m_fileName->toFSPathString().toStdString(), "none", "", &llvmFileSystemAdapter, true);
if (styleFromProjectFolder && !(*styleFromProjectFolder == clang::format::getNoStyle())) {
addQtcStatementMacros(*styleFromProjectFolder);

View File

@@ -326,28 +326,8 @@ void ClangFormatConfigWidget::apply()
if (!m_editorWidget->isEnabled())
return;
clang::format::FormatStyle currentSettingsStyle;
const Utils::expected_str<void> success
= parseConfigurationContent(m_editor->document()->contents().toStdString(),
currentSettingsStyle);
auto saveSettings = [this] {
QString errorString;
m_editor->document()->save(&errorString, m_config->filePath());
};
if (success) {
saveSettings();
return;
}
QMessageBox mBox;
mBox.setText(Tr::tr("The current ClangFormat (C++ > Code Style > ClangFormat) settings are not "
"valid. Are you sure you want to apply them?"));
mBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
mBox.setDefaultButton(QMessageBox::No);
if (mBox.exec() == QMessageBox::Yes)
saveSettings();
QString errorString;
m_editor->document()->save(&errorString, m_config->filePath());
}
TextEditor::CodeStyleEditorWidget *createClangFormatConfigWidget(

View File

@@ -256,8 +256,8 @@ void ClangFormatGlobalConfigWidget::initCurrentProjectLabel()
bool ClangFormatGlobalConfigWidget::projectClangFormatFileExists()
{
llvm::Expected<clang::format::FormatStyle> styleFromProjectFolder
= clang::format::getStyle("file", m_project->projectFilePath().path().toStdString(), "none");
llvm::Expected<clang::format::FormatStyle> styleFromProjectFolder = clang::format::getStyle(
"file", m_project->projectFilePath().path().toStdString(), "none", "", nullptr, true);
return styleFromProjectFolder && !(*styleFromProjectFolder == clang::format::getNoStyle());
}

View File

@@ -394,7 +394,8 @@ Utils::FilePath filePathToCurrentSettings(const TextEditor::ICodeStylePreference
static QString s_errorMessage;
Utils::expected_str<void> parseConfigurationContent(const std::string &fileContent,
clang::format::FormatStyle &style)
clang::format::FormatStyle &style,
bool allowUnknownOptions)
{
auto diagHandler = [](const llvm::SMDiagnostic &diag, void * /*context*/) {
s_errorMessage = QString::fromStdString(diag.getMessage().str()) + " "
@@ -403,11 +404,12 @@ Utils::expected_str<void> parseConfigurationContent(const std::string &fileConte
};
style.Language = clang::format::FormatStyle::LK_Cpp;
const std::error_code error = parseConfiguration(llvm::MemoryBufferRef(fileContent, "YAML"),
&style,
false,
diagHandler,
nullptr);
const std::error_code error = parseConfiguration(
llvm::MemoryBufferRef(fileContent, "YAML"),
&style,
allowUnknownOptions,
diagHandler,
nullptr);
if (error)
return make_unexpected(s_errorMessage);
@@ -418,7 +420,7 @@ Utils::expected_str<void> parseConfigurationFile(const Utils::FilePath &filePath
clang::format::FormatStyle &style)
{
return parseConfigurationContent(filePath.fileContents().value_or(QByteArray()).toStdString(),
style);
style, true);
}
} // namespace ClangFormat

View File

@@ -49,7 +49,8 @@ clang::format::FormatStyle currentQtStyle(const TextEditor::ICodeStylePreference
Utils::FilePath filePathToCurrentSettings(const TextEditor::ICodeStylePreferences *codeStyle);
Utils::expected_str<void> parseConfigurationContent(const std::string &fileContent,
clang::format::FormatStyle &style);
clang::format::FormatStyle &style,
bool allowUnknownOptions = false);
Utils::expected_str<void> parseConfigurationFile(const Utils::FilePath &filePath,
clang::format::FormatStyle &style);

View File

@@ -1463,12 +1463,9 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
buildTypeAspect.setDisplayStyle(StringAspect::LineEditDisplay);
buildTypeAspect.setDefaultValue("Unknown");
initialCMakeArguments.setMacroExpanderProvider([this] { return macroExpander(); });
additionalCMakeOptions.setSettingsKey("CMake.Additional.Options");
additionalCMakeOptions.setLabelText(Tr::tr("Additional CMake <a href=\"options\">options</a>:"));
additionalCMakeOptions.setDisplayStyle(StringAspect::LineEditDisplay);
additionalCMakeOptions.setMacroExpanderProvider([this] { return macroExpander(); });
macroExpander()->registerVariable(DEVELOPMENT_TEAM_FLAG,
Tr::tr("The CMake flag for the development team"),

View File

@@ -84,11 +84,11 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc)
// Cache mime check result for speed up
if (!isIgnored) {
if (auto it = m_mimeBinaryCache.get<std::optional<bool>>(
[mimeType](const QHash<QString, bool> &cache) -> std::optional<bool> {
auto it = cache.find(mimeType.name());
if (it != cache.end())
return *it;
return {};
[mimeType](const QHash<QString, bool> &cache) -> std::optional<bool> {
auto cache_it = cache.find(mimeType.name());
if (cache_it != cache.end())
return *cache_it;
return {};
})) {
isIgnored = *it;
} else {

View File

@@ -20,6 +20,7 @@
#include <extensionsystem/pluginmanager.h>
#include <utils/algorithm.h>
#include <utils/macroexpander.h>
#include <utils/qtcprocess.h>
#include <utils/processinfo.h>
#include <utils/processinterface.h>

View File

@@ -106,8 +106,10 @@ QString compilerPath(QString pathFlag)
Toolchain *toolchainFromFlags(const Kit *kit, const QStringList &flags, const Utils::Id &language)
{
Toolchain * const kitToolchain = ToolchainKitAspect::toolchain(kit, language);
if (flags.empty())
return ToolchainKitAspect::toolchain(kit, language);
return kitToolchain;
// Try exact compiler match.
const Utils::FilePath compiler = Utils::FilePath::fromUserInput(compilerPath(flags.front()));
@@ -118,6 +120,8 @@ Toolchain *toolchainFromFlags(const Kit *kit, const QStringList &flags, const Ut
return toolchain;
Utils::Id compilerId = getCompilerId(compiler.fileName());
if (kitToolchain->isValid() && kitToolchain->typeId() == compilerId)
return kitToolchain;
if ((toolchain = toolchainFromCompilerId(compilerId, language)))
return toolchain;
@@ -126,13 +130,14 @@ Toolchain *toolchainFromFlags(const Kit *kit, const QStringList &flags, const Ut
compilerId = Utils::HostOsInfo::isWindowsHost()
? ProjectExplorer::Constants::CLANG_CL_TOOLCHAIN_TYPEID
: ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID;
if (kitToolchain->isValid() && kitToolchain->typeId() == compilerId)
return kitToolchain;
if ((toolchain = toolchainFromCompilerId(compilerId, language)))
return toolchain;
}
toolchain = ToolchainKitAspect::toolchain(kit, language);
qWarning() << "No matching toolchain found, use the default.";
return toolchain;
return kitToolchain;
}
void addDriverModeFlagIfNeeded(const Toolchain *toolchain,

View File

@@ -169,9 +169,9 @@ void CompilationDbParser::start()
if (!isIgnored) {
if (auto it = m_mimeBinaryCache.get<std::optional<bool>>(
[mimeType](const QHash<QString, bool> &cache) -> std::optional<bool> {
auto it = cache.find(mimeType.name());
if (it != cache.end())
return *it;
const auto cache_it = cache.find(mimeType.name());
if (cache_it != cache.end())
return *cache_it;
return {};
})) {
isIgnored = *it;

View File

@@ -37,6 +37,8 @@ CopilotSettings &settings()
return settings;
}
static const QString entryPointFileName = QStringLiteral("language-server.js");
CopilotSettings::CopilotSettings()
{
setAutoApply(false);
@@ -85,13 +87,16 @@ CopilotSettings::CopilotSettings()
distPath.setExpectedKind(PathChooser::File);
distPath.setDefaultPathValue(distFromVim);
distPath.setSettingsKey("Copilot.DistPath");
distPath.setLabelText(Tr::tr("Path to agent.js:"));
//: %1 is the filename of the copilot language server
distPath.setLabelText(Tr::tr("Path to %1:").arg(entryPointFileName));
distPath.setHistoryCompleter("Copilot.DistPath.History");
distPath.setDisplayName(Tr::tr("Agent.js path"));
//: %1 is the URL to copilot.vim getting started
distPath.setToolTip(Tr::tr("Select path to agent.js in Copilot Neovim plugin. See "
//: %1 is the filename of the copilot language server
distPath.setDisplayName(Tr::tr("%1 path").arg(entryPointFileName));
//: %1 is the URL to copilot.vim getting started, %2 is the filename of the copilot language server
distPath.setToolTip(Tr::tr("Select path to %2 in Copilot Neovim plugin. See "
"%1 for installation instructions.")
.arg("https://github.com/github/copilot.vim#getting-started"));
.arg("https://github.com/github/copilot.vim#getting-started")
.arg(entryPointFileName));
autoComplete.setDisplayName(Tr::tr("Auto Request"));
autoComplete.setSettingsKey("Copilot.Autocomplete");
@@ -197,12 +202,13 @@ CopilotSettings::CopilotSettings()
text(Tr::tr(
"The Copilot plugin requires node.js and the Copilot neovim plugin. "
"If you install the neovim plugin as described in %1, "
"the plugin will find the agent.js file automatically.\n\n"
"the plugin will find the %3 file automatically.\n\n"
"Otherwise you need to specify the path to the %2 "
"file from the Copilot neovim plugin.",
"Markdown text for the copilot instruction label")
.arg("[README.md](https://github.com/github/copilot.vim)")
.arg("[language-server.js](https://github.com/github/copilot.vim/tree/release/dist)"))
.arg("[language-server.js](https://github.com/github/copilot.vim/tree/release/dist)")
.arg(entryPointFileName)),
};
return Column {

View File

@@ -174,7 +174,7 @@ void FileUtils::removeFiles(const FilePaths &filePaths, bool deleteFromFS)
bool FileUtils::renameFile(const FilePath &orgFilePath, const FilePath &newFilePath,
HandleIncludeGuards handleGuards)
{
if (orgFilePath == newFilePath)
if (orgFilePath.equalsCaseSensitive(newFilePath))
return false;
const FilePath dir = orgFilePath.absolutePath();

View File

@@ -30,8 +30,9 @@
#include <QAction>
#include <QActionGroup>
#include <QFutureInterface>
#include <QCoreApplication>
#include <QDebug>
#include <QFutureInterface>
#include <QMenu>
#include <QMessageBox>
#include <QPushButton>

View File

@@ -19,6 +19,7 @@
#include <utils/clangutils.h>
#include <utils/itemviews.h>
#include <utils/layoutbuilder.h>
#include <utils/macroexpander.h>
#include <utils/qtcprocess.h>
#include <utils/variablechooser.h>
@@ -207,17 +208,17 @@ FilePath ClangdSettings::clangdFilePath() const
return fallbackClangdFilePath();
}
FilePath ClangdSettings::projectIndexPath(const Utils::MacroExpander &expander) const
FilePath ClangdSettings::projectIndexPath(const MacroExpander &expander) const
{
return FilePath::fromUserInput(expander.expand(m_data.projectIndexPathTemplate));
}
FilePath ClangdSettings::sessionIndexPath(const Utils::MacroExpander &expander) const
FilePath ClangdSettings::sessionIndexPath(const MacroExpander &expander) const
{
return FilePath::fromUserInput(expander.expand(m_data.sessionIndexPathTemplate));
}
bool ClangdSettings::sizeIsOkay(const Utils::FilePath &fp) const
bool ClangdSettings::sizeIsOkay(const FilePath &fp) const
{
return !sizeThresholdEnabled() || sizeThresholdInKb() * 1024 >= fp.fileSize();
}

View File

@@ -56,11 +56,11 @@ inline QByteArray generateFingerPrint(const QList<CPlusPlus::Macro> &definedMacr
} else {
static const QByteArray def("#define ");
hash.addData(macro.name());
hash.addData(" ", 1);
hash.addData(QByteArrayView(" ", 1));
hash.addData(def);
hash.addData(macro.definitionText());
}
hash.addData("\n", 1);
hash.addData(QByteArrayView("\n", 1));
}
return hash.result();
}

View File

@@ -98,11 +98,6 @@ QString CppToolsJsExtension::classToFileName(const QString &klass, const QString
return finalPath + name + ext;
}
QString CppToolsJsExtension::classToHeaderGuard(const QString &klass, const QString &extension) const
{
return Utils::headerGuard(fileName(className(klass), extension), namespaces(klass));
}
QString CppToolsJsExtension::openNamespaces(const QString &klass) const
{
QString result;

View File

@@ -39,7 +39,6 @@ public:
// Fix the filename casing as configured in C++/File Naming:
Q_INVOKABLE QString classToFileName(const QString &klass,
const QString &extension) const;
Q_INVOKABLE QString classToHeaderGuard(const QString &klass, const QString &extension) const;
Q_INVOKABLE QString openNamespaces(const QString &klass) const;
Q_INVOKABLE QString closeNamespaces(const QString &klass) const;
Q_INVOKABLE bool hasQObjectParent(const QString &klassName) const;

View File

@@ -388,7 +388,7 @@ private:
= Utils::transform<QStringList>(state->namespacePath, [&](const Namespace *ns) {
return ov.prettyName(ns->name());
});
const QString headerGuard = Utils::headerGuard(headerFileName, namespaceNames);
const QString headerGuard = Utils::headerGuard(headerFileName);
if (fileSettings.headerPragmaOnce) {
headerContent.append("#pragma once\n");
} else {

View File

@@ -333,8 +333,8 @@ Utils::Id CvsPluginPrivate::id() const
bool CvsPluginPrivate::isVcsFileOrDirectory(const Utils::FilePath &filePath) const
{
return filePath.isDir()
&& !filePath.fileName().compare("CVS", Utils::HostOsInfo::fileNameCaseSensitivity());
return !filePath.fileName().compare("CVS", Utils::HostOsInfo::fileNameCaseSensitivity())
&& filePath.isDir();
}
bool CvsPluginPrivate::isConfigured() const

View File

@@ -266,7 +266,6 @@ LocalsAndExpressionsSettings::LocalsAndExpressionsSettings()
extraDumperCommands.setSettingsKey(debugModeGroup, "GdbCustomDumperCommands");
extraDumperCommands.setDisplayStyle(StringAspect::TextEditDisplay);
extraDumperCommands.setUseGlobalMacroExpander();
extraDumperCommands.setToolTip("<html><head/><body><p>"
+ Tr::tr("Python commands entered here will be executed after built-in "
"debugging helpers have been loaded and fully initialized. You can "

View File

@@ -553,8 +553,10 @@ void DebuggerEnginePrivate::setupViews()
= new Perspective(perspectiveId, m_engine->displayName(), parentPerspectiveId, settingsId);
m_progress.setProgressRange(0, 1000);
FutureProgress *fp = ProgressManager::addTask(m_progress.future(),
Tr::tr("Launching Debugger"), "Debugger.Launcher");
const QString msg = m_companionEngines.isEmpty()
? Tr::tr("Launching Debugger")
: Tr::tr("Launching %1 Debugger").arg(m_debuggerName);
FutureProgress *fp = ProgressManager::addTask(m_progress.future(), msg, "Debugger.Launcher");
connect(fp, &FutureProgress::canceled, m_engine, &DebuggerEngine::quitDebugger);
m_progress.reportStarted();

View File

@@ -549,7 +549,7 @@ void DebuggerItemModel::autoDetectCdbDebuggers()
for (const QFileInfo &kitFolderFi : kitFolders) {
const QString path = kitFolderFi.absoluteFilePath();
QStringList abis = {"x86", "x64"};
QStringList abis = {"x64"};
if (HostOsInfo::hostArchitecture() == Utils::OsArchArm64)
abis << "arm64";
for (const QString &abi: abis) {

View File

@@ -543,11 +543,11 @@ void DebuggerRunTool::start()
for (auto engine : m_engines) {
engine->setRunParameters(m_runParameters);
engine->setRunId(d->runId);
engine->setRunTool(this);
for (auto companion : m_engines) {
if (companion != engine)
engine->addCompanionEngine(companion);
}
engine->setRunTool(this);
if (!first)
engine->setSecondaryEngine();
auto rc = runControl();

View File

@@ -127,7 +127,6 @@ GdbSettings::GdbSettings()
gdbStartupCommands.setSettingsKey(debugModeGroup, "GdbStartupCommands");
gdbStartupCommands.setDisplayStyle(StringAspect::TextEditDisplay);
gdbStartupCommands.setUseGlobalMacroExpander();
gdbStartupCommands.setToolTip("<html><head/><body><p>" + Tr::tr(
"GDB commands entered here will be executed after "
"GDB has been started, but before the debugged program is started or "
@@ -136,7 +135,6 @@ GdbSettings::GdbSettings()
gdbPostAttachCommands.setSettingsKey(debugModeGroup, "GdbPostAttachCommands");
gdbPostAttachCommands.setDisplayStyle(StringAspect::TextEditDisplay);
gdbPostAttachCommands.setUseGlobalMacroExpander();
gdbPostAttachCommands.setToolTip("<html><head/><body><p>" + Tr::tr(
"GDB commands entered here will be executed after "
"GDB has successfully attached to remote targets.</p>"

View File

@@ -707,7 +707,7 @@ ActionContainer *FormEditorData::createPreviewStyleMenu(QActionGroup *actionGrou
QString name = menuId;
name += dot;
const QVariant data = a->data();
const bool isDeviceProfile = data.typeId() == QVariant::Int;
const bool isDeviceProfile = data.typeId() == QMetaType::Int;
if (isDeviceProfile) {
name += deviceProfilePrefix;
name += dot;

View File

@@ -75,7 +75,7 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete
const QString sourceLicense = CppEditor::AbstractEditorSupport::licenseTemplate(
project, FilePath::fromString(parameters.sourceFile), parameters.className);
// Include guards
const QString guard = Utils::headerGuard(parameters.headerFile, namespaceList);
const QString guard = Utils::headerGuard(parameters.headerFile);
const QString uiInclude = "ui_" + QFileInfo(parameters.uiFile).completeBaseName() + ".h";

View File

@@ -199,7 +199,7 @@ FakeVimSettings::FakeVimSettings()
autoIndent.setValue(true);
smartIndent.setValue(tps.m_autoIndent);
incSearch.setValue(true);
}, nullptr),
}, this),
},
PushButton {
text(Tr::tr("Set Qt Style")),
@@ -213,7 +213,7 @@ FakeVimSettings::FakeVimSettings()
incSearch.setVolatileValue(true);
backspace.setVolatileValue(QString("indent,eol,start"));
passKeys.setVolatileValue(true);
}, nullptr),
}, this),
},
PushButton {
text(Tr::tr("Set Plain Style")),
@@ -227,7 +227,7 @@ FakeVimSettings::FakeVimSettings()
incSearch.setVolatileValue(false);
backspace.setVolatileValue(QString());
passKeys.setVolatileValue(false);
}, nullptr),
}, this),
},
st
},

View File

@@ -742,9 +742,8 @@ void FossilClient::annotate(const FilePath &workingDir, const QString &file, int
bool FossilClient::isVcsFileOrDirectory(const FilePath &filePath) const
{
// false for any dir or file other than fossil checkout db-file
return filePath.toFileInfo().isFile()
&& !filePath.fileName().compare(Constants::FOSSILREPO,
HostOsInfo::fileNameCaseSensitivity());
return !filePath.fileName().compare(Constants::FOSSILREPO, HostOsInfo::fileNameCaseSensitivity())
&& filePath.isFile();
}
FilePath FossilClient::findTopLevelForFile(const FilePath &file) const

View File

@@ -695,8 +695,10 @@ void LanguageClientSettings::toSettings(QtcSettings *settings,
QVariantList typedSettingsVariant;
for (const QVariant &var : settings->value(typedClientsKey).toList()) {
const Store map = storeFromVariant(var);
Id typeId = Id::fromSetting(map.value(typeIdKey));
if (typeId.isValid() && !clientTypes().contains(typeId))
const Id typeId = Id::fromSetting(map.value(typeIdKey));
const QString id = map.value(idKey).toString();
if (typeId.isValid() && !clientTypes().contains(typeId)
&& !Utils::anyOf(typedSettings, Utils::equal(&BaseSettings::m_id, id)))
typedSettingsVariant << var;
}

View File

@@ -294,8 +294,13 @@ public:
}
}
// TODO: Unregister Client settings from LanguageClientManager
~LuaClientWrapper() = default;
~LuaClientWrapper()
{
for (auto client : m_clients)
LanguageClientManager::shutdownClient(client);
// TODO: Unregister Client settings from LanguageClientManager
}
TransportType transportType() { return m_transportType; }
@@ -338,9 +343,15 @@ public:
for (Client *c : m_clients) {
for (const auto &[msg, func] : m_messageCallbacks.asKeyValueRange()) {
c->registerCustomMethod(
msg, [name = msg, f = func](const LanguageServerProtocol::JsonRpcMessage &m) {
auto table = ::Lua::LuaEngine::toTable(f.lua_state(), m.toJsonObject());
auto result = f.call(table);
msg,
[self = QPointer<LuaClientWrapper>(this),
name = msg](const LanguageServerProtocol::JsonRpcMessage &m) {
if (!self)
return;
auto func = self->m_messageCallbacks.value(name);
auto table = ::Lua::LuaEngine::toTable(func.lua_state(), m.toJsonObject());
auto result = func.call(table);
if (!result.valid()) {
qWarning() << "Error calling message callback for:" << name << ":"
<< (result.get<sol::error>().what());

View File

@@ -4,6 +4,7 @@ add_qtc_plugin(Lua
PUBLIC_DEPENDS lua546 sol2
PUBLIC_DEFINES LUA_AVAILABLE
SOURCES
wizards/wizards.qrc
bindings/action.cpp
bindings/async.cpp
bindings/core.cpp

View File

@@ -93,10 +93,21 @@ HAS_MEM_FUNC(onClicked, hasOnClicked);
HAS_MEM_FUNC(setText, hasSetText);
HAS_MEM_FUNC(setTitle, hasSetTitle);
HAS_MEM_FUNC(setValue, hasSetValue);
HAS_MEM_FUNC(setSize, hasSetSize);
template<class T>
void setProperties(std::unique_ptr<T> &item, const sol::table &children, QObject *guard)
{
if constexpr (hasSetSize<T, void (T::*)(int, int)>::value) {
sol::optional<sol::table> size = children.get<sol::optional<sol::table>>("size");
if (size) {
if (size->size() == 2)
item->setSize(size->get<int>(1), size->get<int>(2));
else
throw sol::error("size must have exactly two elements");
}
}
if constexpr (hasOnTextChanged<T, void (T::*)(const QString &)>::value) {
sol::optional<sol::protected_function> onTextChanged
= children.get<sol::optional<sol::protected_function>>("onTextChanged");
@@ -233,8 +244,7 @@ void addGuiModule()
gui.new_usertype<Space>("Space", sol::call_constructor, sol::constructors<Space(int)>());
gui.new_usertype<Stretch>(
"Stretch", sol::call_constructor, sol::constructors<Stretch(int)>());
gui.new_usertype<Stretch>("Stretch", sol::call_constructor, sol::constructors<Stretch(int)>());
// Layouts
gui.new_usertype<Layout>(
@@ -306,8 +316,6 @@ void addGuiModule()
}),
"show",
&Widget::show,
"setSize",
&Widget::setSize,
sol::base_classes,
sol::bases<Object, Thing>());

View File

@@ -21,6 +21,7 @@ QtcPlugin {
"luaqttypes.h",
"luatr.h",
"luauibindings.cpp",
"wizards/wizards.qrc",
]
Group {

View File

@@ -0,0 +1 @@
print("Hello, World!")

View File

@@ -0,0 +1,41 @@
{
"version": 1,
"supportedProjectTypes": [],
"id": "Q.Lua",
"category": "R.Lua",
"trDescription": "Creates a simple lua file.",
"trDisplayName": "Lua Script",
"trDisplayCategory": "Lua",
"iconText": "ts",
"enabled": "%{JS: value('Plugins').indexOf('Lua') >= 0}",
"options": [
{
"key": "DefaultSuffix",
"value": "%{JS: Util.preferredSuffix('text/x-lua')}"
}
],
"pages": [
{
"trDisplayName": "Location",
"trShortTitle": "Location",
"typeId": "File"
},
{
"trDisplayName": "Project Management",
"trShortTitle": "Summary",
"typeId": "Summary"
}
],
"generators": [
{
"typeId": "File",
"data": [
{
"source": "script.lua",
"target": "%{JS: Util.fileName(value('TargetPath'), value('DefaultSuffix'))}",
"openInEditor": true
}
]
}
]
}

View File

@@ -0,0 +1,9 @@
{
"workspace.library": [
"%{JS: Lua.metaFolder()}"
],
"hint.paramName": "Literal",
"hint.enable": true,
"hint.await": true,
"hint.arrayIndex": "Disable"
}

View File

@@ -0,0 +1,7 @@
local function setup()
print("Hello from Lua!")
end
return {
setup = setup
}

View File

@@ -0,0 +1,24 @@
return {
Name = "%{ProjectName}",
Version = "1.0.0",
CompatVersion = "1.0.0",
Vendor = "%{VendorName}",
Copyright = "%{Copyright}",
License = "%{License}",
Category = "My Plugins",
Description = "%{Description}",
Url = "%{Url}",
Experimental = true,
DisabledByDefault = false,
LongDescription = [[
This plugin provides some functionality.
You can describe it more here.
]],
Dependencies = {
{ Name = "Core", Version = "%{JS: Util.qtCreatorIdeVersion()}", Required = true },
{ Name = "Lua", Version = "%{JS: Util.qtCreatorIdeVersion()}", Required = true },
},
setup = function()
require 'init'.setup()
end
} --[[@as QtcPlugin]]

View File

@@ -0,0 +1,15 @@
{
"targets": [
{
"name": "Qt Creator",
"executable": "%\{IDE:Executable:FilePath\}",
"arguments": [
"-tcs",
"-load",
"Lua",
"-loadluaplugin",
"%\{ActiveProject:ProjectDirectory\}"
]
}
]
}

View File

@@ -0,0 +1,163 @@
{
"version": 1,
"supportedProjectTypes": [
"Qt4ProjectManager.Qt4Project"
],
"id": "R.QtCreatorLuaPlugin",
"category": "G.Library",
"trDescription": "Creates a custom Qt Creator Lua plugin.",
"trDisplayName": "Qt Creator Lua Plugin",
"trDisplayCategory": "Library",
"iconText": "LuaP",
"featuresRequired": [
"QtSupport.Wizards.FeatureQt",
"QtSupport.Wizards.FeatureDesktop"
],
"enabled": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}",
"options": [
{
"key": "ProjectFile",
"value": "%{ProjectDirectory}/.qtcreator/project.json"
},
{
"key": "PluginNameLower",
"value": "%{JS: value('PluginName').toLowerCase()}"
},
{
"key": "PluginSpecFile",
"value": "%{JS: Util.fileName(value('PluginName').toLowerCase(), Util.preferredSuffix('text/x-lua'))}"
},
{
"key": "SrcFileName",
"value": "init.lua"
},
{
"key": "CN",
"value": "%{JS: Cpp.className(value('PluginName') + 'Plugin')}"
},
{
"key": "HasTranslation",
"value": "%{JS: value('TsFileName') !== ''}"
}
],
"pages": [
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project",
"data": {
"trDescription": "This wizard creates a custom Qt Creator lua plugin."
}
},
{
"trDisplayName": "Define Project Details",
"trShortTitle": "Details",
"typeId": "Fields",
"data": [
{
"name": "ClassPageDescription",
"type": "Label",
"data": {
"trText": "Specify details about your custom Qt Creator lua plugin.",
"wordWrap": true
}
},
{
"name": "PluginName",
"trDisplayName": "Plugin name:",
"mandatory": true,
"type": "LineEdit",
"data": {
"validator": "[a-zA-Z_][a-zA-Z_0-9]*",
"text": "%{JS: value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1)}"
}
},
{
"name": "VendorName",
"persistenceKey": "VendorName",
"trDisplayName": "Vendor name:",
"mandatory": true,
"type": "LineEdit",
"data": {
"trText": "MyCompany"
}
},
{
"name": "Copyright",
"trDisplayName": "Copyright:",
"mandatory": true,
"type": "LineEdit",
"data": {
"trText": "(C) %{VendorName}"
}
},
{
"name": "License",
"trDisplayName": "License:",
"mandatory": true,
"type": "LineEdit",
"data": {
"trText": "Put short license information here"
}
},
{
"name": "Description",
"trDisplayName": "Description:",
"mandatory": true,
"type": "LineEdit",
"data": {
"trText": "Put a short description of your plugin here"
}
},
{
"name": "Url",
"persistenceKey": "VendorUrl",
"trDisplayName": "URL:",
"mandatory": true,
"type": "LineEdit",
"data": {
"text": "https://www.%{JS: encodeURIComponent(value('VendorName').toLowerCase())}.com"
}
}
]
},
{
"trDisplayName": "Kit Selection",
"trShortTitle": "Kits",
"typeId": "Kits",
"enabled": "%{JS: !value('IsSubproject')}",
"data": {
"projectFilePath": "%{ProjectFile}"
}
},
{
"trDisplayName": "Project Management",
"trShortTitle": "Summary",
"typeId": "Summary"
}
],
"generators": [
{
"typeId": "File",
"data": [
{
"source": "project.json",
"target": "%{ProjectFile}",
"openAsProject": true
},
{
"source": "init.lua.tpl",
"target": "%{SrcFileName}"
},
{
"source": ".luarc.json"
},
{
"source": "plugin.lua.tpl",
"target": "%{PluginSpecFile}",
"openInEditor": true
}
]
}
]
}

View File

@@ -0,0 +1,11 @@
<RCC>
<qresource prefix="/lua/wizards">
<file>luafile/wizard.json</file>
<file>luafile/script.lua</file>
<file>plugin/init.lua.tpl</file>
<file>plugin/plugin.lua.tpl</file>
<file>plugin/project.json</file>
<file>plugin/wizard.json</file>
<file>plugin/.luarc.json</file>
</qresource>
</RCC>

View File

@@ -7,4 +7,5 @@ add_qtc_lua_plugin(luatests
luatests/tst_aspectcontainer.lua
luatests/tst_fetch.lua
luatests/tst_utils.lua
luatests/guidemo.lua
)

View File

@@ -3,6 +3,7 @@ QtcLuaPlugin {
luafiles: [
"inspect.lua",
"guidemo.lua",
"luatests.lua",
"qtctest.lua",
"tests.lua",

View File

@@ -0,0 +1,23 @@
-- Copyright (C) 2024 The Qt Company Ltd.
-- SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
local Utils = require("Utils")
local Gui = require("Gui")
local function using(tbl)
local result = _G
for k, v in pairs(tbl) do result[k] = v end
return result
end
local function show()
--- "using namespace Gui"
local _ENV = using(Gui)
Widget {
size = { 400, 300 },
Row { "Hello World!" },
}:show()
end
return show

View File

@@ -64,6 +64,19 @@ local function setup()
text = "Run lua tests",
onTrigger = function() a.sync(runTests)() end,
})
Action.create("LuaTests.layoutDemo", {
text = "Lua Layout Demo",
onTrigger = function()
local script, err = loadfile(Utils.FilePath.fromUserInput(script_path()):parentDir():resolvePath(
"guidemo.lua"):nativePath())
if not script then
print("Failed to load demo:", err)
return
end
script()()
end,
})
end
return { setup = setup }

View File

@@ -62,6 +62,7 @@ public:
Column {
Row {
m_searcher,
m_errorLabel,
customMargins(0, 0, ExVPaddingGapXl, 0),
},
m_sectionedProducts,

View File

@@ -347,8 +347,9 @@ void MercurialClient::revertAll(const FilePath &workingDir, const QString &revis
bool MercurialClient::isVcsDirectory(const FilePath &filePath) const
{
return filePath.isDir()
&& !filePath.fileName().compare(Constants::MERCURIALREPO, HostOsInfo::fileNameCaseSensitivity());
return !filePath.fileName()
.compare(Constants::MERCURIALREPO, HostOsInfo::fileNameCaseSensitivity())
&& filePath.isDir();
}
void MercurialClient::view(const FilePath &source, const QString &id,

View File

@@ -194,7 +194,6 @@ BuildConfiguration::BuildConfiguration(Target *target, Utils::Id id)
d->m_buildDirectoryAspect.setBaseFileName(target->project()->projectDirectory());
d->m_buildDirectoryAspect.setEnvironment(environment());
d->m_buildDirectoryAspect.setMacroExpanderProvider([this] { return macroExpander(); });
connect(&d->m_buildDirectoryAspect, &StringAspect::changed,
this, &BuildConfiguration::emitBuildDirectoryChanged);
connect(this, &BuildConfiguration::environmentChanged, this, [this] {

View File

@@ -59,7 +59,6 @@ BuildPropertiesSettings::BuildPropertiesSettings()
"The default value can be set using the environment variable "
"<tt>%1</tt>")
.arg(Constants::QTC_DEFAULT_BUILD_DIRECTORY_TEMPLATE));
buildDirectoryTemplate.setUseGlobalMacroExpander();
buildDirectoryTemplate.setUseResetButton();
separateDebugInfo.setSettingsKey("ProjectExplorer/Settings/SeparateDebugInfo");

View File

@@ -85,6 +85,9 @@ BuildStep::BuildStep(BuildStepList *bsl, Id id)
: ProjectConfiguration(bsl->target(), id)
, m_stepList(bsl)
{
if (auto bc = buildConfiguration())
setMacroExpander(bc->macroExpander());
connect(this, &ProjectConfiguration::displayNameChanged, this, &BuildStep::updateSummary);
}
@@ -120,12 +123,8 @@ QWidget *BuildStep::createConfigWidget()
form.flush();
}
}
auto widget = form.emerge();
if (m_addMacroExpander)
VariableChooser::addSupportForChildWidgets(widget, macroExpander());
return widget;
return form.emerge();
}
void BuildStep::fromMap(const Store &map)
@@ -196,13 +195,6 @@ BuildConfiguration::BuildType BuildStep::buildType() const
return BuildConfiguration::Unknown;
}
MacroExpander *BuildStep::macroExpander() const
{
if (auto bc = buildConfiguration())
return bc->macroExpander();
return globalMacroExpander();
}
QString BuildStep::fallbackWorkingDirectory() const
{
if (buildConfiguration())

View File

@@ -52,7 +52,6 @@ public:
BuildSystem *buildSystem() const;
BuildConfiguration::BuildType buildType() const;
Utils::MacroExpander *macroExpander() const;
enum class OutputFormat {
Stdout, Stderr, // These are for forwarded output from external tools
@@ -99,7 +98,6 @@ protected:
void setWidgetExpandedByDefault(bool widgetExpandedByDefault);
void setImmutable(bool immutable) { m_immutable = immutable; }
void setSummaryUpdater(const std::function<QString()> &summaryUpdater);
void addMacroExpander() { m_addMacroExpander = true; }
void setSummaryText(const QString &summaryText);
DeployConfiguration *deployConfiguration() const;
@@ -119,7 +117,6 @@ private:
bool m_enabled = true;
bool m_immutable = false;
bool m_widgetExpandedByDefault = true;
bool m_addMacroExpander = false;
std::optional<bool> m_wasExpanded;
std::function<QString()> m_summaryUpdater;

View File

@@ -28,15 +28,13 @@ public:
m_targetAspect.setSettingsKey(TARGET_KEY);
m_targetAspect.setLabelText(Tr::tr("Target:"));
addMacroExpander();
}
protected:
bool init() final
{
m_source = m_sourceAspect();
m_target = m_targetAspect();
m_source = m_sourceAspect.expandedValue();
m_target = m_targetAspect.expandedValue();
return m_source.exists();
}

View File

@@ -60,8 +60,6 @@ public:
setupProcessParameters(&param);
return param.summary(display);
});
addMacroExpander();
}
private:

View File

@@ -6,6 +6,7 @@
#include "target.h"
#include <utils/algorithm.h>
#include <utils/macroexpander.h>
#include <utils/qtcassert.h>
using namespace ProjectExplorer;

View File

@@ -3877,7 +3877,7 @@ ProjectExplorerPlugin::renameFile(Node *node, const QString &newFileName)
const FilePath newFilePath = FilePath::fromString(newFileName);
if (oldFilePath == newFilePath)
if (oldFilePath.equalsCaseSensitive(newFilePath))
return {};
const HandleIncludeGuards handleGuards = canTryToRenameIncludeGuards(node);

View File

@@ -291,7 +291,8 @@ bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int rol
// The base name of the file was changed. Go look for other files with the same base name
// and offer to rename them as well.
if (orgFilePath != newFilePath && orgFilePath.suffix() == newFilePath.suffix()) {
if (!orgFilePath.equalsCaseSensitive(newFilePath)
&& orgFilePath.suffix() == newFilePath.suffix()) {
const QList<Node *> candidateNodes = ProjectTree::siblingsWithSameBaseName(node);
if (!candidateNodes.isEmpty()) {
QStringList fileNames = transform<QStringList>(candidateNodes, [](const Node *n) {

View File

@@ -180,8 +180,6 @@ public:
executable.setLabelText(Tr::tr("Executable:"));
executable.setReadOnly(true);
executable.setValue(bti.targetFilePath);
executable.setMacroExpanderProvider(
[this]() -> MacroExpander * { return const_cast<MacroExpander *>(macroExpander()); });
auto argumentsAsString = [this]() {
return CommandLine{

View File

@@ -50,7 +50,7 @@ CustomQbsPropertiesDialog::CustomQbsPropertiesDialog(const QVariantMap &properti
Column {
PushButton {
text(Tr::tr("&Add")),
onClicked([this] { addProperty(); }, nullptr),
onClicked([this] { addProperty(); }, this),
},
m_removeButton,
st

View File

@@ -4,9 +4,6 @@
#include "qbsprofilemanager.h"
#include "defaultpropertyprovider.h"
#include "qbsproject.h"
#include "qbsprojectmanagerconstants.h"
#include "qbsprojectmanagerplugin.h"
#include "qbsprojectmanagertr.h"
#include "qbssettings.h"
@@ -82,9 +79,9 @@ QString toJSLiteral(const QVariant &val)
str += '}';
return str;
}
if (val.typeId() == QVariant::Bool)
if (val.typeId() == QMetaType::Bool)
return toJSLiteral(val.toBool());
if (val.canConvert(QMetaType::QString))
if (val.canConvert(QMetaType(QMetaType::QString)))
return toJSLiteral(val.toString());
return QString::fromLatin1("Unconvertible type %1").arg(QLatin1String(val.typeName()));
}

View File

@@ -133,11 +133,11 @@ QbsProfilesSettingsWidget::QbsProfilesSettingsWidget()
Column {
PushButton {
text(Tr::tr("E&xpand All")),
onClicked([this] { m_propertiesView->expandAll(); }, nullptr),
onClicked([this] { m_propertiesView->expandAll(); }, this),
},
PushButton {
text(Tr::tr("&Collapse All")),
onClicked([this] { m_propertiesView->collapseAll(); }, nullptr),
onClicked([this] { m_propertiesView->collapseAll(); }, this),
},
st,
},

View File

@@ -3,7 +3,6 @@
#include "formeditorgraphicsview.h"
#include "backgroundaction.h"
#include "formeditoritem.h"
#include "formeditorwidget.h"
#include "navigation2d.h"
@@ -76,11 +75,11 @@ bool FormEditorGraphicsView::eventFilter(QObject *watched, QEvent *event)
auto mouseEvent = static_cast<QMouseEvent *>(event);
if (!m_panningStartPosition.isNull()) {
horizontalScrollBar()->setValue(horizontalScrollBar()->value() -
(mouseEvent->x() - m_panningStartPosition.x()));
(mouseEvent->position().x() - m_panningStartPosition.x()));
verticalScrollBar()->setValue(verticalScrollBar()->value() -
(mouseEvent->y() - m_panningStartPosition.y()));
(mouseEvent->position().y() - m_panningStartPosition.y()));
}
m_panningStartPosition = mouseEvent->pos();
m_panningStartPosition = mouseEvent->position();
event->accept();
return true;
}

View File

@@ -46,7 +46,7 @@ private:
void stopPanning(QEvent *event);
Panning m_isPanning = Panning::NotStarted;
QPoint m_panningStartPosition;
QPointF m_panningStartPosition;
QRectF m_rootItemRect;
QImage m_backgroundImage;
};

View File

@@ -29,7 +29,7 @@ public:
QVariant maybeConvertToNumber(const QVariant &value)
{
if (value.typeId() == QVariant::Bool)
if (value.typeId() == QMetaType::Bool)
return value;
if (value.typeId() == QMetaType::QString) {

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