diff --git a/README.md b/README.md index 7feacabd332..274c5094868 100644 --- a/README.md +++ b/README.md @@ -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, diff --git a/dist/changelog/changes-14.0.0.md b/dist/changelog/changes-14.0.0.md new file mode 100644 index 00000000000..00ba593c720 --- /dev/null +++ b/dist/changelog/changes-14.0.0.md @@ -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 diff --git a/dist/changelog/template.md b/dist/changelog/template.md index 9fe0d1f1f7a..cfbdad4677f 100644 --- a/dist/changelog/template.md +++ b/dist/changelog/template.md @@ -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: diff --git a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc index 447f3067d47..04dceb49160 100644 --- a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc +++ b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc @@ -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 diff --git a/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc b/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc index c612eb8642b..b2ea02c1280 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc @@ -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} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc index c2d2fe9e2dd..f2d8d254249 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc @@ -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 diff --git a/scripts/build.py b/scripts/build.py index 66d5d25d43a..094cc9d6c4b 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -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) diff --git a/share/qtcreator/templates/wizards/projects/qtquick2-extension/wizard.json b/share/qtcreator/templates/wizards/projects/qtquick2-extension/wizard.json index 0164a9f3d57..d12edc4576d 100644 --- a/share/qtcreator/templates/wizards/projects/qtquick2-extension/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquick2-extension/wizard.json @@ -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}'}" }, diff --git a/src/libs/advanceddockingsystem/workspaceview.cpp b/src/libs/advanceddockingsystem/workspaceview.cpp index 26983c2bcd7..116ad95670c 100644 --- a/src/libs/advanceddockingsystem/workspaceview.cpp +++ b/src/libs/advanceddockingsystem/workspaceview.cpp @@ -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(); diff --git a/src/libs/extensionsystem/invoker.h b/src/libs/extensionsystem/invoker.h index 8cd27eb1759..ada8aa7cf51 100644 --- a/src/libs/extensionsystem/invoker.h +++ b/src/libs/extensionsystem/invoker.h @@ -38,7 +38,7 @@ private: InvokerBase(const InvokerBase &); // Unimplemented. template const char *typeName() { - return QMetaType::typeName(qMetaTypeId()); + return QMetaType(qMetaTypeId()).name(); } QObject *target; QGenericArgument arg[10]; diff --git a/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramview.cpp b/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramview.cpp index eba246676d1..555dc812e62 100644 --- a/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramview.cpp +++ b/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramview.cpp @@ -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(); diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.cpp b/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.cpp index 875b1fa1058..e2006a37b5d 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.cpp +++ b/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.cpp @@ -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(); diff --git a/src/libs/solutions/tasking/barrier.cpp b/src/libs/solutions/tasking/barrier.cpp index 74c11f50de5..650aae3403b 100644 --- a/src/libs/solutions/tasking/barrier.cpp +++ b/src/libs/solutions/tasking/barrier.cpp @@ -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 diff --git a/src/libs/solutions/tasking/barrier.h b/src/libs/solutions/tasking/barrier.h index 88ef5f9a96e..a484844d38e 100644 --- a/src/libs/solutions/tasking/barrier.h +++ b/src/libs/solutions/tasking/barrier.h @@ -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 &sharedBarrier) } } // namespace Tasking + +QT_END_NAMESPACE + +#endif // TASKING_BARRIER_H diff --git a/src/libs/solutions/tasking/concurrentcall.h b/src/libs/solutions/tasking/concurrentcall.h index a3721fca0cf..ae1fcd17cd5 100644 --- a/src/libs/solutions/tasking/concurrentcall.h +++ b/src/libs/solutions/tasking/concurrentcall.h @@ -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 +QT_BEGIN_NAMESPACE + namespace Tasking { // This class introduces the dependency to Qt::Concurrent, otherwise Tasking namespace @@ -98,3 +102,7 @@ template using ConcurrentCallTask = CustomTask>; } // namespace Tasking + +QT_END_NAMESPACE + +#endif // TASKING_CONCURRENTCALL_H diff --git a/src/libs/solutions/tasking/networkquery.cpp b/src/libs/solutions/tasking/networkquery.cpp index c3de4455eb6..30789ec925b 100644 --- a/src/libs/solutions/tasking/networkquery.cpp +++ b/src/libs/solutions/tasking/networkquery.cpp @@ -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 +QT_BEGIN_NAMESPACE + namespace Tasking { void NetworkQuery::start() @@ -51,3 +54,5 @@ NetworkQuery::~NetworkQuery() } } // namespace Tasking + +QT_END_NAMESPACE diff --git a/src/libs/solutions/tasking/networkquery.h b/src/libs/solutions/tasking/networkquery.h index b8ad13bdfae..6d288486712 100644 --- a/src/libs/solutions/tasking/networkquery.h +++ b/src/libs/solutions/tasking/networkquery.h @@ -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; } // namespace Tasking + +QT_END_NAMESPACE + +#endif // TASKING_NETWORKQUERY_H diff --git a/src/libs/solutions/tasking/qprocesstask.cpp b/src/libs/solutions/tasking/qprocesstask.cpp index 70f9cc2ad8e..b0a61986a38 100644 --- a/src/libs/solutions/tasking/qprocesstask.cpp +++ b/src/libs/solutions/tasking/qprocesstask.cpp @@ -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 #include +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) + diff --git a/src/libs/solutions/tasking/qprocesstask.h b/src/libs/solutions/tasking/qprocesstask.h index fb71d159aab..3b06e624fb5 100644 --- a/src/libs/solutions/tasking/qprocesstask.h +++ b/src/libs/solutions/tasking/qprocesstask.h @@ -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 +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; } // namespace Tasking + +#endif // QT_CONFIG(process) + +QT_END_NAMESPACE + +#endif // TASKING_QPROCESSTASK_H diff --git a/src/libs/solutions/tasking/tasking_global.h b/src/libs/solutions/tasking/tasking_global.h index 9d9e183b9a3..024d7e33036 100644 --- a/src/libs/solutions/tasking/tasking_global.h +++ b/src/libs/solutions/tasking/tasking_global.h @@ -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 +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 diff --git a/src/libs/solutions/tasking/tasktree.cpp b/src/libs/solutions/tasking/tasktree.cpp index c5a6ed6a70e..2c7a5a8dedb 100644 --- a/src/libs/solutions/tasking/tasktree.cpp +++ b/src/libs/solutions/tasking/tasktree.cpp @@ -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 diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 06a3d4ea79c..caedb78c2c8 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -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 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; using TimeoutTask = CustomTask; } // namespace Tasking + +QT_END_NAMESPACE + +#endif // TASKING_TASKTREE_H diff --git a/src/libs/solutions/tasking/tasktreerunner.cpp b/src/libs/solutions/tasking/tasktreerunner.cpp index 0f7e96db088..d0daa5daaed 100644 --- a/src/libs/solutions/tasking/tasktreerunner.cpp +++ b/src/libs/solutions/tasking/tasktreerunner.cpp @@ -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 diff --git a/src/libs/solutions/tasking/tasktreerunner.h b/src/libs/solutions/tasking/tasktreerunner.h index 766ea074f50..ba41c0913fd 100644 --- a/src/libs/solutions/tasking/tasktreerunner.h +++ b/src/libs/solutions/tasking/tasktreerunner.h @@ -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 +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 diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 13db6a1ecef..e6b8267c4ed 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -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 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(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 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(); + 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(Tr::tr("Reset")); resetButton->setEnabled(lineEditDisplay->text() != defaultValue()); @@ -1255,6 +1259,7 @@ void StringAspect::addToLayout(Layout &parent) } case TextEditDisplay: { auto textEditDisplay = createSubWidget(); + 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 m_pathChooserDisplay; - MacroExpanderProvider m_expanderProvider; FilePath m_baseFileName; StringAspect::ValueAcceptor m_valueAcceptor; std::optional 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(); + 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. diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 8faeaf7a9e3..60a198c1f7b 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -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 &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 T *aspect() const { for (BaseAspect *aspect : aspects()) diff --git a/src/libs/utils/dropsupport.cpp b/src/libs/utils/dropsupport.cpp index 7416edf9c37..4ed12456438 100644 --- a/src/libs/utils/dropsupport.cpp +++ b/src/libs/utils/dropsupport.cpp @@ -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); } diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index c631034eba2..c4d77a29efc 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -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) diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index cb975248ec2..e742bf1a0de 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -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); diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index e285ed98f6c..6f33e4f5ca4 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -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 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) diff --git a/src/libs/utils/layoutbuilder.h b/src/libs/utils/layoutbuilder.h index eb516cecc88..a411ea47633 100644 --- a/src/libs/utils/layoutbuilder.h +++ b/src/libs/utils/layoutbuilder.h @@ -41,13 +41,12 @@ namespace Layouting { class NestId {}; -template +template 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 @@ -107,7 +106,7 @@ public: template BuilderItem(IdAndArg && idarg) { - apply = [&idarg](X *x) { doit(x, idarg.id, idarg.arg); }; + apply = [&idarg](X *x) { doit(x, Id{}, idarg.arg); }; } std::function apply; @@ -143,17 +142,15 @@ public: class FlowLayout; class Layout; using LayoutModifier = std::function; -// 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 diff --git a/src/libs/utils/macroexpander.h b/src/libs/utils/macroexpander.h index adde4db1d3f..fe98d46872f 100644 --- a/src/libs/utils/macroexpander.h +++ b/src/libs/utils/macroexpander.h @@ -5,7 +5,6 @@ #include "utils_global.h" -#include #include #include diff --git a/src/plugins/appstatisticsmonitor/CMakeLists.txt b/src/plugins/appstatisticsmonitor/CMakeLists.txt index 292eb2a3eb2..92ae05962c9 100644 --- a/src/plugins/appstatisticsmonitor/CMakeLists.txt +++ b/src/plugins/appstatisticsmonitor/CMakeLists.txt @@ -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 diff --git a/src/plugins/appstatisticsmonitor/idataprovider.cpp b/src/plugins/appstatisticsmonitor/idataprovider.cpp index b2026e67cdb..f8cb70fddd6 100644 --- a/src/plugins/appstatisticsmonitor/idataprovider.cpp +++ b/src/plugins/appstatisticsmonitor/idataprovider.cpp @@ -15,6 +15,11 @@ #include #endif +#ifdef Q_OS_WIN +#include +#include +#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(memoryUsed) / (1024.0 * 1024.0); + } + + CloseHandle(process); + return static_cast(memoryUsed) / static_cast(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 diff --git a/src/plugins/baremetal/BareMetal.json.in b/src/plugins/baremetal/BareMetal.json.in index 805beb7cff6..7499c5a773e 100644 --- a/src/plugins/baremetal/BareMetal.json.in +++ b/src/plugins/baremetal/BareMetal.json.in @@ -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" ], diff --git a/src/plugins/bazaar/bazaarclient.cpp b/src/plugins/bazaar/bazaarclient.cpp index 303b7e21c28..77cfd1545cf 100644 --- a/src/plugins/bazaar/bazaarclient.cpp +++ b/src/plugins/bazaar/bazaarclient.cpp @@ -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 diff --git a/src/plugins/boot2qt/Boot2Qt.json.in b/src/plugins/boot2qt/Boot2Qt.json.in index 9bc2be52d87..c2ece20d50e 100644 --- a/src/plugins/boot2qt/Boot2Qt.json.in +++ b/src/plugins/boot2qt/Boot2Qt.json.in @@ -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" diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index 295c86fcb6f..ee89619225c 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -961,12 +961,8 @@ const clang::format::FormatStyle &ClangFormatBaseIndenterPrivate::styleForFile() return m_cachedStyle.style; } - llvm::Expected styleFromProjectFolder - = clang::format::getStyle("file", - m_fileName->toFSPathString().toStdString(), - "none", - "", - &llvmFileSystemAdapter); + llvm::Expected styleFromProjectFolder = clang::format::getStyle( + "file", m_fileName->toFSPathString().toStdString(), "none", "", &llvmFileSystemAdapter, true); if (styleFromProjectFolder && !(*styleFromProjectFolder == clang::format::getNoStyle())) { addQtcStatementMacros(*styleFromProjectFolder); diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index ec1afdcfc1f..418769cbf12 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -326,28 +326,8 @@ void ClangFormatConfigWidget::apply() if (!m_editorWidget->isEnabled()) return; - clang::format::FormatStyle currentSettingsStyle; - const Utils::expected_str 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( diff --git a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp index 27629823426..fdcceea62b4 100644 --- a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp @@ -256,8 +256,8 @@ void ClangFormatGlobalConfigWidget::initCurrentProjectLabel() bool ClangFormatGlobalConfigWidget::projectClangFormatFileExists() { - llvm::Expected styleFromProjectFolder - = clang::format::getStyle("file", m_project->projectFilePath().path().toStdString(), "none"); + llvm::Expected styleFromProjectFolder = clang::format::getStyle( + "file", m_project->projectFilePath().path().toStdString(), "none", "", nullptr, true); return styleFromProjectFolder && !(*styleFromProjectFolder == clang::format::getNoStyle()); } diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 6732524f41e..7beb062a45e 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -394,7 +394,8 @@ Utils::FilePath filePathToCurrentSettings(const TextEditor::ICodeStylePreference static QString s_errorMessage; Utils::expected_str 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 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 parseConfigurationFile(const Utils::FilePath &filePath clang::format::FormatStyle &style) { return parseConfigurationContent(filePath.fileContents().value_or(QByteArray()).toStdString(), - style); + style, true); } } // namespace ClangFormat diff --git a/src/plugins/clangformat/clangformatutils.h b/src/plugins/clangformat/clangformatutils.h index 019414b11f5..bea4cdb8cb8 100644 --- a/src/plugins/clangformat/clangformatutils.h +++ b/src/plugins/clangformat/clangformatutils.h @@ -49,7 +49,8 @@ clang::format::FormatStyle currentQtStyle(const TextEditor::ICodeStylePreference Utils::FilePath filePathToCurrentSettings(const TextEditor::ICodeStylePreferences *codeStyle); Utils::expected_str parseConfigurationContent(const std::string &fileContent, - clang::format::FormatStyle &style); + clang::format::FormatStyle &style, + bool allowUnknownOptions = false); Utils::expected_str parseConfigurationFile(const Utils::FilePath &filePath, clang::format::FormatStyle &style); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 274ebd8f83f..696ce44c1e2 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -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 options:")); additionalCMakeOptions.setDisplayStyle(StringAspect::LineEditDisplay); - additionalCMakeOptions.setMacroExpanderProvider([this] { return macroExpander(); }); macroExpander()->registerVariable(DEVELOPMENT_TEAM_FLAG, Tr::tr("The CMake flag for the development team"), diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 730cdaed4cf..13aee2f2de9 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -84,11 +84,11 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc) // Cache mime check result for speed up if (!isIgnored) { if (auto it = m_mimeBinaryCache.get>( - [mimeType](const QHash &cache) -> std::optional { - auto it = cache.find(mimeType.name()); - if (it != cache.end()) - return *it; - return {}; + [mimeType](const QHash &cache) -> std::optional { + auto cache_it = cache.find(mimeType.name()); + if (cache_it != cache.end()) + return *cache_it; + return {}; })) { isIgnored = *it; } else { diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 618c42892f2..3df6a6bbcb6 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp index af22b135203..c7118690871 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp @@ -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, diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp index d613c81faf5..97ed389bc2b 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp @@ -169,9 +169,9 @@ void CompilationDbParser::start() if (!isIgnored) { if (auto it = m_mimeBinaryCache.get>( [mimeType](const QHash &cache) -> std::optional { - 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; diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index af16b56db57..81fd4c3b126 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -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 { diff --git a/src/plugins/coreplugin/fileutils.cpp b/src/plugins/coreplugin/fileutils.cpp index f7c7d4a759c..e05375393da 100644 --- a/src/plugins/coreplugin/fileutils.cpp +++ b/src/plugins/coreplugin/fileutils.cpp @@ -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(); diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index 921046ffed4..4cb088b3ff7 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -30,8 +30,9 @@ #include #include -#include +#include #include +#include #include #include #include diff --git a/src/plugins/cppeditor/clangdsettings.cpp b/src/plugins/cppeditor/clangdsettings.cpp index daa78aad7eb..78cce6df1c0 100644 --- a/src/plugins/cppeditor/clangdsettings.cpp +++ b/src/plugins/cppeditor/clangdsettings.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -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(); } diff --git a/src/plugins/cppeditor/cppsourceprocessor.cpp b/src/plugins/cppeditor/cppsourceprocessor.cpp index 4cdc6962416..7796c5d2ab1 100644 --- a/src/plugins/cppeditor/cppsourceprocessor.cpp +++ b/src/plugins/cppeditor/cppsourceprocessor.cpp @@ -56,11 +56,11 @@ inline QByteArray generateFingerPrint(const QList &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(); } diff --git a/src/plugins/cppeditor/cpptoolsjsextension.cpp b/src/plugins/cppeditor/cpptoolsjsextension.cpp index 607744eec1b..c03a38ede2b 100644 --- a/src/plugins/cppeditor/cpptoolsjsextension.cpp +++ b/src/plugins/cppeditor/cpptoolsjsextension.cpp @@ -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; diff --git a/src/plugins/cppeditor/cpptoolsjsextension.h b/src/plugins/cppeditor/cpptoolsjsextension.h index 593f9536411..3b74ebde703 100644 --- a/src/plugins/cppeditor/cpptoolsjsextension.h +++ b/src/plugins/cppeditor/cpptoolsjsextension.h @@ -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; diff --git a/src/plugins/cppeditor/quickfixes/moveclasstoownfile.cpp b/src/plugins/cppeditor/quickfixes/moveclasstoownfile.cpp index e8a6c9b33fe..4b83faaf2d4 100644 --- a/src/plugins/cppeditor/quickfixes/moveclasstoownfile.cpp +++ b/src/plugins/cppeditor/quickfixes/moveclasstoownfile.cpp @@ -388,7 +388,7 @@ private: = Utils::transform(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 { diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 6a25b29fa04..4d6a8e51789 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -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 diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 5739845fe65..b7c56541b82 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -266,7 +266,6 @@ LocalsAndExpressionsSettings::LocalsAndExpressionsSettings() extraDumperCommands.setSettingsKey(debugModeGroup, "GdbCustomDumperCommands"); extraDumperCommands.setDisplayStyle(StringAspect::TextEditDisplay); - extraDumperCommands.setUseGlobalMacroExpander(); extraDumperCommands.setToolTip("

" + Tr::tr("Python commands entered here will be executed after built-in " "debugging helpers have been loaded and fully initialized. You can " diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 1aa77ae3ea3..b0ff79f5d1e 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -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(); diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index b93e0800dec..4d9d663d0d0 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -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) { diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 522191e25b3..5688ff191ad 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -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(); diff --git a/src/plugins/debugger/gdb/gdbsettings.cpp b/src/plugins/debugger/gdb/gdbsettings.cpp index e88e9f4f8a9..9ca93263069 100644 --- a/src/plugins/debugger/gdb/gdbsettings.cpp +++ b/src/plugins/debugger/gdb/gdbsettings.cpp @@ -127,7 +127,6 @@ GdbSettings::GdbSettings() gdbStartupCommands.setSettingsKey(debugModeGroup, "GdbStartupCommands"); gdbStartupCommands.setDisplayStyle(StringAspect::TextEditDisplay); - gdbStartupCommands.setUseGlobalMacroExpander(); gdbStartupCommands.setToolTip("

" + 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("

" + Tr::tr( "GDB commands entered here will be executed after " "GDB has successfully attached to remote targets.

" diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index aaf4a921dde..dd99b4194fb 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -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; diff --git a/src/plugins/designer/qtdesignerformclasscodegenerator.cpp b/src/plugins/designer/qtdesignerformclasscodegenerator.cpp index 677494658b4..e0afdc45d97 100644 --- a/src/plugins/designer/qtdesignerformclasscodegenerator.cpp +++ b/src/plugins/designer/qtdesignerformclasscodegenerator.cpp @@ -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"; diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index e6a2a661d52..35cdce0bafb 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -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 }, diff --git a/src/plugins/fossil/fossilclient.cpp b/src/plugins/fossil/fossilclient.cpp index 2c077a3b591..d80dc223cd6 100644 --- a/src/plugins/fossil/fossilclient.cpp +++ b/src/plugins/fossil/fossilclient.cpp @@ -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 diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 4176918015c..b9db9807174 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -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; } diff --git a/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp b/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp index 44fd187a729..67c0cf893a2 100644 --- a/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp +++ b/src/plugins/languageclient/lualanguageclient/lualanguageclient.cpp @@ -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(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().what()); diff --git a/src/plugins/lua/CMakeLists.txt b/src/plugins/lua/CMakeLists.txt index c7a62e3a8b8..8a3bb96dc11 100644 --- a/src/plugins/lua/CMakeLists.txt +++ b/src/plugins/lua/CMakeLists.txt @@ -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 diff --git a/src/plugins/lua/bindings/gui.cpp b/src/plugins/lua/bindings/gui.cpp index aaba86f461c..d34848ebc2f 100644 --- a/src/plugins/lua/bindings/gui.cpp +++ b/src/plugins/lua/bindings/gui.cpp @@ -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 void setProperties(std::unique_ptr &item, const sol::table &children, QObject *guard) { + if constexpr (hasSetSize::value) { + sol::optional size = children.get>("size"); + if (size) { + if (size->size() == 2) + item->setSize(size->get(1), size->get(2)); + else + throw sol::error("size must have exactly two elements"); + } + } + if constexpr (hasOnTextChanged::value) { sol::optional onTextChanged = children.get>("onTextChanged"); @@ -233,8 +244,7 @@ void addGuiModule() gui.new_usertype("Space", sol::call_constructor, sol::constructors()); - gui.new_usertype( - "Stretch", sol::call_constructor, sol::constructors()); + gui.new_usertype("Stretch", sol::call_constructor, sol::constructors()); // Layouts gui.new_usertype( @@ -306,8 +316,6 @@ void addGuiModule() }), "show", &Widget::show, - "setSize", - &Widget::setSize, sol::base_classes, sol::bases()); diff --git a/src/plugins/lua/lua.qbs b/src/plugins/lua/lua.qbs index 1b49d94f519..2a539bb0b4d 100644 --- a/src/plugins/lua/lua.qbs +++ b/src/plugins/lua/lua.qbs @@ -21,6 +21,7 @@ QtcPlugin { "luaqttypes.h", "luatr.h", "luauibindings.cpp", + "wizards/wizards.qrc", ] Group { diff --git a/src/plugins/lua/wizards/luafile/script.lua b/src/plugins/lua/wizards/luafile/script.lua new file mode 100644 index 00000000000..7df869a15e7 --- /dev/null +++ b/src/plugins/lua/wizards/luafile/script.lua @@ -0,0 +1 @@ +print("Hello, World!") diff --git a/src/plugins/lua/wizards/luafile/wizard.json b/src/plugins/lua/wizards/luafile/wizard.json new file mode 100644 index 00000000000..eb1a0863d00 --- /dev/null +++ b/src/plugins/lua/wizards/luafile/wizard.json @@ -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 + } + ] + } + ] +} diff --git a/src/plugins/lua/wizards/plugin/.luarc.json b/src/plugins/lua/wizards/plugin/.luarc.json new file mode 100644 index 00000000000..00b63f41f20 --- /dev/null +++ b/src/plugins/lua/wizards/plugin/.luarc.json @@ -0,0 +1,9 @@ +{ + "workspace.library": [ + "%{JS: Lua.metaFolder()}" + ], + "hint.paramName": "Literal", + "hint.enable": true, + "hint.await": true, + "hint.arrayIndex": "Disable" +} diff --git a/src/plugins/lua/wizards/plugin/init.lua.tpl b/src/plugins/lua/wizards/plugin/init.lua.tpl new file mode 100644 index 00000000000..2e4203e2c8e --- /dev/null +++ b/src/plugins/lua/wizards/plugin/init.lua.tpl @@ -0,0 +1,7 @@ +local function setup() + print("Hello from Lua!") +end + +return { + setup = setup +} diff --git a/src/plugins/lua/wizards/plugin/plugin.lua.tpl b/src/plugins/lua/wizards/plugin/plugin.lua.tpl new file mode 100644 index 00000000000..9675a2a0051 --- /dev/null +++ b/src/plugins/lua/wizards/plugin/plugin.lua.tpl @@ -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]] diff --git a/src/plugins/lua/wizards/plugin/project.json b/src/plugins/lua/wizards/plugin/project.json new file mode 100644 index 00000000000..f537bf2ea9d --- /dev/null +++ b/src/plugins/lua/wizards/plugin/project.json @@ -0,0 +1,15 @@ +{ + "targets": [ + { + "name": "Qt Creator", + "executable": "%\{IDE:Executable:FilePath\}", + "arguments": [ + "-tcs", + "-load", + "Lua", + "-loadluaplugin", + "%\{ActiveProject:ProjectDirectory\}" + ] + } + ] +} diff --git a/src/plugins/lua/wizards/plugin/wizard.json b/src/plugins/lua/wizards/plugin/wizard.json new file mode 100644 index 00000000000..f854a49a3c1 --- /dev/null +++ b/src/plugins/lua/wizards/plugin/wizard.json @@ -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 + } + ] + } + ] +} diff --git a/src/plugins/lua/wizards/wizards.qrc b/src/plugins/lua/wizards/wizards.qrc new file mode 100644 index 00000000000..098c2c3f418 --- /dev/null +++ b/src/plugins/lua/wizards/wizards.qrc @@ -0,0 +1,11 @@ + + + luafile/wizard.json + luafile/script.lua + plugin/init.lua.tpl + plugin/plugin.lua.tpl + plugin/project.json + plugin/wizard.json + plugin/.luarc.json + + diff --git a/src/plugins/luatests/CMakeLists.txt b/src/plugins/luatests/CMakeLists.txt index 80e03b66ca4..0bad7da433b 100644 --- a/src/plugins/luatests/CMakeLists.txt +++ b/src/plugins/luatests/CMakeLists.txt @@ -7,4 +7,5 @@ add_qtc_lua_plugin(luatests luatests/tst_aspectcontainer.lua luatests/tst_fetch.lua luatests/tst_utils.lua + luatests/guidemo.lua ) diff --git a/src/plugins/luatests/luatests.qbs b/src/plugins/luatests/luatests.qbs index d521ed9b71c..687cd6579bd 100644 --- a/src/plugins/luatests/luatests.qbs +++ b/src/plugins/luatests/luatests.qbs @@ -3,6 +3,7 @@ QtcLuaPlugin { luafiles: [ "inspect.lua", + "guidemo.lua", "luatests.lua", "qtctest.lua", "tests.lua", diff --git a/src/plugins/luatests/luatests/guidemo.lua b/src/plugins/luatests/luatests/guidemo.lua new file mode 100644 index 00000000000..2771529f87a --- /dev/null +++ b/src/plugins/luatests/luatests/guidemo.lua @@ -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 diff --git a/src/plugins/luatests/luatests/tests.lua b/src/plugins/luatests/luatests/tests.lua index fb246ae94de..213aff47ebf 100644 --- a/src/plugins/luatests/luatests/tests.lua +++ b/src/plugins/luatests/luatests/tests.lua @@ -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 } diff --git a/src/plugins/marketplace/qtmarketplacewelcomepage.cpp b/src/plugins/marketplace/qtmarketplacewelcomepage.cpp index f26a618a10a..954eb55f144 100644 --- a/src/plugins/marketplace/qtmarketplacewelcomepage.cpp +++ b/src/plugins/marketplace/qtmarketplacewelcomepage.cpp @@ -62,6 +62,7 @@ public: Column { Row { m_searcher, + m_errorLabel, customMargins(0, 0, ExVPaddingGapXl, 0), }, m_sectionedProducts, diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index 6140706d001..d73d7655738 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -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, diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index a69133b2190..6cc025d8770 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -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] { diff --git a/src/plugins/projectexplorer/buildpropertiessettings.cpp b/src/plugins/projectexplorer/buildpropertiessettings.cpp index ff7c1808518..ebfe8782151 100644 --- a/src/plugins/projectexplorer/buildpropertiessettings.cpp +++ b/src/plugins/projectexplorer/buildpropertiessettings.cpp @@ -59,7 +59,6 @@ BuildPropertiesSettings::BuildPropertiesSettings() "The default value can be set using the environment variable " "%1") .arg(Constants::QTC_DEFAULT_BUILD_DIRECTORY_TEMPLATE)); - buildDirectoryTemplate.setUseGlobalMacroExpander(); buildDirectoryTemplate.setUseResetButton(); separateDebugInfo.setSettingsKey("ProjectExplorer/Settings/SeparateDebugInfo"); diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index a290fc0c69a..19eb143d245 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -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()) diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index ed07d763e7a..4fd01f0eb33 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -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 &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 m_wasExpanded; std::function m_summaryUpdater; diff --git a/src/plugins/projectexplorer/copystep.cpp b/src/plugins/projectexplorer/copystep.cpp index be6c9bb730f..812fcb31348 100644 --- a/src/plugins/projectexplorer/copystep.cpp +++ b/src/plugins/projectexplorer/copystep.cpp @@ -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(); } diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index 782eadf91df..18547fcb015 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -60,8 +60,6 @@ public: setupProcessParameters(¶m); return param.summary(display); }); - - addMacroExpander(); } private: diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index 33285507453..423ed95479e 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -6,6 +6,7 @@ #include "target.h" #include +#include #include using namespace ProjectExplorer; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index b9da6f33a87..d4c5717ce3d 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -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); diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 484bc5a0192..5f5aa0150e1 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -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 candidateNodes = ProjectTree::siblingsWithSameBaseName(node); if (!candidateNodes.isEmpty()) { QStringList fileNames = transform(candidateNodes, [](const Node *n) { diff --git a/src/plugins/projectexplorer/workspaceproject.cpp b/src/plugins/projectexplorer/workspaceproject.cpp index 2a22c65c4be..5b0a92ba6c9 100644 --- a/src/plugins/projectexplorer/workspaceproject.cpp +++ b/src/plugins/projectexplorer/workspaceproject.cpp @@ -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()); }); auto argumentsAsString = [this]() { return CommandLine{ diff --git a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp index ad8c5d79950..13e6e09dd31 100644 --- a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp +++ b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp @@ -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 diff --git a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp index 01dd5efb4fe..4968d3d2163 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp +++ b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp @@ -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())); } diff --git a/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp b/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp index 9b25c17d341..34bc379db2a 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp +++ b/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp @@ -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, }, diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorgraphicsview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorgraphicsview.cpp index 4bd0b08c0a1..d835274a97c 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorgraphicsview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorgraphicsview.cpp @@ -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(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; } diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorgraphicsview.h b/src/plugins/qmldesigner/components/formeditor/formeditorgraphicsview.h index 60e02582cd1..e1e61a8f1e2 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorgraphicsview.h +++ b/src/plugins/qmldesigner/components/formeditor/formeditorgraphicsview.h @@ -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; }; diff --git a/src/plugins/qmldesigner/components/listmodeleditor/listmodeleditormodel.cpp b/src/plugins/qmldesigner/components/listmodeleditor/listmodeleditormodel.cpp index 6ab97b4307c..f97b6f74acc 100644 --- a/src/plugins/qmldesigner/components/listmodeleditor/listmodeleditormodel.cpp +++ b/src/plugins/qmldesigner/components/listmodeleditor/listmodeleditormodel.cpp @@ -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) { diff --git a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp index 97ef6c4b689..127780f9181 100644 --- a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp +++ b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp @@ -265,7 +265,7 @@ void TextEditorWidget::dragEnterEvent(QDragEnterEvent *dragEnterEvent) void TextEditorWidget::dragMoveEvent(QDragMoveEvent *dragMoveEvent) { - QTextCursor cursor = m_textEditor->editorWidget()->cursorForPosition(dragMoveEvent->pos()); + QTextCursor cursor = m_textEditor->editorWidget()->cursorForPosition(dragMoveEvent->position().toPoint()); const int cursorPosition = cursor.position(); RewriterView *rewriterView = m_textEditorView->model()->rewriterView(); @@ -279,7 +279,7 @@ void TextEditorWidget::dragMoveEvent(QDragMoveEvent *dragMoveEvent) void TextEditorWidget::dropEvent(QDropEvent *dropEvent) { - QTextCursor cursor = m_textEditor->editorWidget()->cursorForPosition(dropEvent->pos()); + QTextCursor cursor = m_textEditor->editorWidget()->cursorForPosition(dropEvent->position().toPoint()); const int cursorPosition = cursor.position(); RewriterView *rewriterView = m_textEditorView->model()->rewriterView(); diff --git a/src/plugins/qmldesigner/designercore/model/propertyparser.cpp b/src/plugins/qmldesigner/designercore/model/propertyparser.cpp index 788530c291a..264c944feab 100644 --- a/src/plugins/qmldesigner/designercore/model/propertyparser.cpp +++ b/src/plugins/qmldesigner/designercore/model/propertyparser.cpp @@ -201,7 +201,7 @@ QVariant read(const QString &typeStr, const QString &str, const MetaInfo &) QVariant read(const QString &typeStr, const QString &str) { - int type = QMetaType::type(typeStr.toUtf8().constData()); + int type = QMetaType::fromName(typeStr.toUtf8().constData()).id(); if (type == 0) { if (typeStr != "binding"_L1 && typeStr != "enum"_L1) { qWarning() << "Type " << typeStr @@ -270,15 +270,14 @@ QVariant read(int variantType, const QString &str) value = QVariant::fromValue(enumerationFromString(str, &conversionOk)); } else { value = QVariant(str); - value.convert(static_cast(variantType)); + value.convert(QMetaType(variantType)); } break; } } if (!conversionOk) { - qWarning() << "Could not convert" << str - << "to" << QMetaType::typeName(variantType); + qWarning() << "Could not convert" << str << "to" << QMetaType(variantType).name(); value = QVariant(str); } diff --git a/src/plugins/qnx/Qnx.json.in b/src/plugins/qnx/Qnx.json.in index dc266e0dedc..0cd5d9f251e 100644 --- a/src/plugins/qnx/Qnx.json.in +++ b/src/plugins/qnx/Qnx.json.in @@ -15,7 +15,7 @@ "Category" : "Device Support", "Description" : "Develop for QNX Neutrino devices", "LongDescription" : [ - "Connect devices with USB or WLAN to run, debug, and analyze applications built for them.", + "Connect devices with USB or over a network to run, debug, and analyze applications built for them.", "You also need:", "- Qt for QNX", "- QNX Software Development Platform (SDP)" diff --git a/src/plugins/remotelinux/customcommanddeploystep.cpp b/src/plugins/remotelinux/customcommanddeploystep.cpp index 97826fde5e9..2850e59f0cf 100644 --- a/src/plugins/remotelinux/customcommanddeploystep.cpp +++ b/src/plugins/remotelinux/customcommanddeploystep.cpp @@ -31,8 +31,6 @@ public: commandLine.setHistoryCompleter("RemoteLinuxCustomCommandDeploymentStep.History"); setInternalInitializer([this] { return isDeploymentPossible(); }); - - addMacroExpander(); } expected_str isDeploymentPossible() const final; diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index c971c8caa2e..d51df10bef4 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -58,6 +58,8 @@ using namespace Utils; namespace RemoteLinux { +const char DisconnectedKey[] = "Disconnected"; + const QByteArray s_pidMarker = "__qtc"; static Q_LOGGING_CATEGORY(linuxDeviceLog, "qtc.remotelinux.device", QtWarningMsg); @@ -364,6 +366,9 @@ Environment LinuxDevicePrivate::getEnvironment() if (m_environmentCache.has_value()) return m_environmentCache.value(); + if (m_disconnected) + return {}; + Process getEnvProc; getEnvProc.setCommand(CommandLine{q->filePath("env")}); using namespace std::chrono; @@ -705,6 +710,11 @@ void SshProcessInterfacePrivate::start() this, &SshProcessInterfacePrivate::handleDisconnected); auto linuxDevice = std::dynamic_pointer_cast(m_device); QTC_ASSERT(linuxDevice, handleDone(); return); + if (linuxDevice->isDisconnected()) { + emit q->done({-1, QProcess::CrashExit, QProcess::FailedToStart, + Tr::tr("Device \"%1\" is disconnected").arg(linuxDevice->displayName())}); + return; + } linuxDevice->connectionAccess() ->attachToSharedConnection(m_connectionHandle.get(), m_sshParameters); } else { @@ -1063,6 +1073,19 @@ LinuxDevice::LinuxDevice() }}); } +void LinuxDevice::fromMap(const Utils::Store &map) +{ + IDevice::fromMap(map); + d->m_disconnected = map.value(DisconnectedKey, false).toBool(); +} + +Store LinuxDevice::toMap() const +{ + Store map = IDevice::toMap(); + map.insert(DisconnectedKey, d->m_disconnected); + return map; +} + void LinuxDevice::_setOsType(Utils::OsType osType) { qCDebug(linuxDeviceLog) << "Setting OS type to" << osType << "for" << displayName(); @@ -1191,8 +1214,10 @@ void LinuxDevicePrivate::checkOsType() // Call me with shell mutex locked bool LinuxDevicePrivate::setupShell(const SshParameters &sshParameters, bool announce) { - if (m_handler->isRunning(sshParameters)) + if (m_handler->isRunning(sshParameters)) { + setDisconnected(false); return true; + } invalidateEnvironmentCache(); diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index 06e0da3f2a8..48c22c52619 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -55,6 +55,9 @@ public: protected: LinuxDevice(); + void fromMap(const Utils::Store &map) override; + Utils::Store toMap() const override; + void _setOsType(Utils::OsType osType); class LinuxDevicePrivate *d; diff --git a/src/plugins/rustls/rustls/init.lua b/src/plugins/rustls/rustls/init.lua index 474c368f3a9..fcfd4954fef 100644 --- a/src/plugins/rustls/rustls/init.lua +++ b/src/plugins/rustls/rustls/init.lua @@ -27,12 +27,8 @@ end local function installOrUpdateServer() local data = a.wait(fetch({ - url = "https://api.github.com/repos/rust-lang/rust-analyzer/releases?per_page=2", + url = "https://qtccache.qt.io/RustLanguageServer/LatestReleases", convertToTable = true, - headers = { - Accept = "application/vnd.github.v3+json", - ["X-GitHub-Api-Version"] = "2022-11-28" - } })) if type(data) == "table" and #data > 1 then diff --git a/src/plugins/scxmleditor/common/graphicsview.cpp b/src/plugins/scxmleditor/common/graphicsview.cpp index cfb45caf135..cd8bfd4bd17 100644 --- a/src/plugins/scxmleditor/common/graphicsview.cpp +++ b/src/plugins/scxmleditor/common/graphicsview.cpp @@ -175,8 +175,8 @@ void GraphicsView::dragMoveEvent(QDragMoveEvent *event) ScxmlTag *targetTag = nullptr; - QList parentItems = items(event->pos()); - QPointF sceneP = mapToScene(event->pos()); + QList parentItems = items(event->position().toPoint()); + QPointF sceneP = mapToScene(event->position().toPoint()); for (int i = 0; i < parentItems.count(); ++i) { auto item = static_cast(parentItems[i]); if (item && item->type() >= TransitionType && item->containsScenePoint(sceneP)) { @@ -206,9 +206,9 @@ void GraphicsView::dropEvent(QDropEvent *event) int shapeIndex = event->mimeData()->data("shapeIndex").toInt(); ScxmlTag *targetTag = nullptr; - QPointF targetPos = mapToScene(event->pos()); + QPointF targetPos = mapToScene(event->position().toPoint()); - QList parentItems = items(event->pos()); + QList parentItems = items(event->position().toPoint()); for (int i = 0; i < parentItems.count(); ++i) { auto item = static_cast(parentItems[i]); if (item && item->type() >= StateType) { diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 36a5455a629..2339893fcd4 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -477,9 +477,9 @@ SubversionPluginPrivate::SubversionPluginPrivate() bool SubversionPluginPrivate::isVcsDirectory(const FilePath &fileName) const { const QString baseName = fileName.fileName(); - return fileName.isDir() && contains(m_svnDirectories, [baseName](const QString &s) { + return contains(m_svnDirectories, [baseName](const QString &s) { return !baseName.compare(s, HostOsInfo::fileNameCaseSensitivity()); - }); + }) && fileName.isDir(); } bool SubversionPluginPrivate::activateCommit() diff --git a/src/plugins/texteditor/CMakeLists.txt b/src/plugins/texteditor/CMakeLists.txt index 978d0de86a7..22abf9d8a1e 100644 --- a/src/plugins/texteditor/CMakeLists.txt +++ b/src/plugins/texteditor/CMakeLists.txt @@ -92,7 +92,6 @@ add_qtc_plugin(TextEditor snippets/snippetparser.cpp snippets/snippetparser.h snippets/snippetprovider.cpp snippets/snippetprovider.h snippets/snippetscollection.cpp snippets/snippetscollection.h - snippets/snippetssettings.cpp snippets/snippetssettings.h snippets/snippetssettingspage.cpp snippets/snippetssettingspage.h storagesettings.cpp storagesettings.h syntaxhighlighter.cpp syntaxhighlighter.h diff --git a/src/plugins/texteditor/snippets/snippetssettings.cpp b/src/plugins/texteditor/snippets/snippetssettings.cpp deleted file mode 100644 index cce25bc7109..00000000000 --- a/src/plugins/texteditor/snippets/snippetssettings.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "snippetssettings.h" - -#include - -using namespace Utils; - -namespace TextEditor { - -const char kGroupPostfix[] = "SnippetsSettings"; -const char kLastUsedSnippetGroup[] = "LastUsedSnippetGroup"; - -void SnippetsSettings::toSettings(const Key &category, QtcSettings *s) const -{ - const Key group = category + kGroupPostfix; - s->beginGroup(group); - s->setValue(kLastUsedSnippetGroup, m_lastUsedSnippetGroup); - s->endGroup(); -} - -void SnippetsSettings::fromSettings(const Key &category, QtcSettings *s) -{ - const Key group = category + kGroupPostfix; - s->beginGroup(group); - m_lastUsedSnippetGroup = s->value(kLastUsedSnippetGroup, QString()).toString(); - s->endGroup(); -} - -void SnippetsSettings::setLastUsedSnippetGroup(const QString &lastUsed) -{ - m_lastUsedSnippetGroup = lastUsed; -} - -const QString &SnippetsSettings::lastUsedSnippetGroup() const -{ - return m_lastUsedSnippetGroup; -} - -bool SnippetsSettings::equals(const SnippetsSettings &snippetsSettings) const -{ - return m_lastUsedSnippetGroup == snippetsSettings.m_lastUsedSnippetGroup; -} - -} // TextEditor diff --git a/src/plugins/texteditor/snippets/snippetssettings.h b/src/plugins/texteditor/snippets/snippetssettings.h deleted file mode 100644 index 732d51f6716..00000000000 --- a/src/plugins/texteditor/snippets/snippetssettings.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include - -namespace Utils { -class Key; -class QtcSettings; -} // Utils - -namespace TextEditor { - -class SnippetsSettings -{ -public: - SnippetsSettings() = default; - - void toSettings(const Utils::Key &category, Utils::QtcSettings *s) const; - void fromSettings(const Utils::Key &category, Utils::QtcSettings *s); - - void setLastUsedSnippetGroup(const QString &lastUsed); - const QString &lastUsedSnippetGroup() const; - - bool equals(const SnippetsSettings &snippetsSettings) const; - - friend bool operator==(const SnippetsSettings &a, const SnippetsSettings &b) - { return a.equals(b); } - friend bool operator!=(const SnippetsSettings &a, const SnippetsSettings &b) - { return !a.equals(b); } - -private: - QString m_lastUsedSnippetGroup; -}; - -} // TextEditor diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.cpp b/src/plugins/texteditor/snippets/snippetssettingspage.cpp index 51deff5ad1f..546d532bbf3 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.cpp +++ b/src/plugins/texteditor/snippets/snippetssettingspage.cpp @@ -7,7 +7,6 @@ #include "snippetprovider.h" #include "snippet.h" #include "snippetscollection.h" -#include "snippetssettings.h" #include "../fontsettings.h" #include "../textdocument.h" #include "../texteditorconstants.h" @@ -39,6 +38,8 @@ using namespace Utils; namespace TextEditor::Internal { +const char kLastUsedSnippetGroup[] = "TextSnippetsSettings/LastUsedSnippetGroup"; + // SnippetsTableModel class SnippetsTableModel : public QAbstractTableModel @@ -244,8 +245,6 @@ void SnippetsTableModel::replaceSnippet(const Snippet &snippet, const QModelInde } } -// SnippetsSettingsWidget - class SnippetsSettingsWidget : public Core::IOptionsPageWidget { public: @@ -275,10 +274,9 @@ private: bool settingsChanged() const; void writeSettings(); - const Key m_settingsPrefix{"Text"}; SnippetsTableModel m_model; bool m_snippetsCollectionChanged = false; - SnippetsSettings m_settings; + QString m_lastUsedSnippetGroup; QStackedWidget *m_snippetsEditorStack; QComboBox *m_groupCombo; @@ -407,9 +405,8 @@ void SnippetsSettingsWidget::loadSettings() if (m_groupCombo->count() == 0) return; - m_settings.fromSettings(m_settingsPrefix, Core::ICore::settings()); - const QString &lastGroupName = m_settings.lastUsedSnippetGroup(); - const int index = m_groupCombo->findText(lastGroupName); + m_lastUsedSnippetGroup = Core::ICore::settings()->value(kLastUsedSnippetGroup, QString()).toString(); + const int index = m_groupCombo->findText(m_lastUsedSnippetGroup); if (index != -1) m_groupCombo->setCurrentIndex(index); else @@ -421,15 +418,13 @@ void SnippetsSettingsWidget::writeSettings() if (m_groupCombo->count() == 0) return; - m_settings.setLastUsedSnippetGroup(m_groupCombo->currentText()); - m_settings.toSettings(m_settingsPrefix, Core::ICore::settings()); + m_lastUsedSnippetGroup = m_groupCombo->currentText(); + Core::ICore::settings()->setValue(kLastUsedSnippetGroup, m_lastUsedSnippetGroup); } bool SnippetsSettingsWidget::settingsChanged() const { - if (m_settings.lastUsedSnippetGroup() != m_groupCombo->currentText()) - return true; - return false; + return m_lastUsedSnippetGroup != m_groupCombo->currentText(); } void SnippetsSettingsWidget::loadSnippetGroup(int index) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 03164abb36b..d75db87a166 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -7577,7 +7577,7 @@ bool TextEditorWidget::openLink(const Utils::Link &link, bool inNextSplit) #endif QString url = link.targetFilePath.toString(); - if (url.startsWith(u"https://"_qs) || url.startsWith(u"http://"_qs)) { + if (url.startsWith(u"https://") || url.startsWith(u"http://")) { QDesktopServices::openUrl(url); return true; } @@ -7616,11 +7616,12 @@ void TextEditorWidgetPrivate::requestUpdateLink(QMouseEvent *e) return; // Check that the mouse was actually on the text somewhere - bool onText = q->cursorRect(cursor).right() >= e->x(); + const int posX = e->position().x(); + bool onText = q->cursorRect(cursor).right() >= posX; if (!onText) { QTextCursor nextPos = cursor; nextPos.movePosition(QTextCursor::Right); - onText = q->cursorRect(nextPos).right() >= e->x(); + onText = q->cursorRect(nextPos).right() >= posX; } if (onText) { @@ -9232,7 +9233,7 @@ void TextEditorWidget::dragLeaveEvent(QDragLeaveEvent *) void TextEditorWidget::dragMoveEvent(QDragMoveEvent *e) { const QRect rect = cursorRect(d->m_dndCursor); - d->m_dndCursor = cursorForPosition(e->pos()); + d->m_dndCursor = cursorForPosition(e->position().toPoint()); if (!rect.isNull()) viewport()->update(rect); viewport()->update(cursorRect(d->m_dndCursor)); @@ -9250,7 +9251,7 @@ void TextEditorWidget::dropEvent(QDropEvent *e) // Update multi text cursor before inserting data MultiTextCursor cursor = multiTextCursor(); cursor.beginEditBlock(); - const QTextCursor eventCursor = cursorForPosition(e->pos()); + const QTextCursor eventCursor = cursorForPosition(e->position().toPoint()); if (e->dropAction() == Qt::MoveAction && e->source() == viewport()) cursor.removeSelectedText(); cursor.setCursors({eventCursor}); diff --git a/src/plugins/texteditor/texteditor.qbs b/src/plugins/texteditor/texteditor.qbs index 7c0ee120934..ccb298a5aa8 100644 --- a/src/plugins/texteditor/texteditor.qbs +++ b/src/plugins/texteditor/texteditor.qbs @@ -222,8 +222,6 @@ QtcPlugin { "snippetprovider.h", "snippetscollection.cpp", "snippetscollection.h", - "snippetssettings.cpp", - "snippetssettings.h", "snippetssettingspage.cpp", "snippetssettingspage.h", ] diff --git a/src/plugins/vcsbase/commonvcssettings.cpp b/src/plugins/vcsbase/commonvcssettings.cpp index 1dbbb130dc5..9bc924c1d4c 100644 --- a/src/plugins/vcsbase/commonvcssettings.cpp +++ b/src/plugins/vcsbase/commonvcssettings.cpp @@ -94,7 +94,7 @@ CommonVcsSettings::CommonVcsSettings() text(Tr::tr("Reset VCS Cache")), Layouting::toolTip(Tr::tr("Reset information about which " "version control system handles which directory.")), - onClicked(&VcsManager::clearVersionControlCache, (QObject *)nullptr) + onClicked(&VcsManager::clearVersionControlCache, this) } } }; diff --git a/src/shared/qbs b/src/shared/qbs index 1ee1e51fa98..7ca1715dd49 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 1ee1e51fa98f89ae4ee977f6074d070f5788c633 +Subproject commit 7ca1715dd49a33215068e5e701ae4c851d3716e5 diff --git a/src/tools/qml2puppet/instances/nodeinstanceclientproxy.cpp b/src/tools/qml2puppet/instances/nodeinstanceclientproxy.cpp index 6ba2fa7fcaa..de07782d1cf 100644 --- a/src/tools/qml2puppet/instances/nodeinstanceclientproxy.cpp +++ b/src/tools/qml2puppet/instances/nodeinstanceclientproxy.cpp @@ -131,17 +131,17 @@ void NodeInstanceClientProxy::initializeCapturedStream(const QString &fileName) bool compareCommands(const QVariant &command, const QVariant &controlCommand) { - static const int informationChangedCommandType = QMetaType::type("InformationChangedCommand"); - static const int valuesChangedCommandType = QMetaType::type("ValuesChangedCommand"); - static const int valuesModifiedCommandType = QMetaType::type("ValuesModifiedCommand"); - static const int pixmapChangedCommandType = QMetaType::type("PixmapChangedCommand"); - static const int childrenChangedCommandType = QMetaType::type("ChildrenChangedCommand"); - static const int statePreviewImageChangedCommandType = QMetaType::type("StatePreviewImageChangedCommand"); - static const int componentCompletedCommandType = QMetaType::type("ComponentCompletedCommand"); - static const int synchronizeCommandType = QMetaType::type("SynchronizeCommand"); - static const int tokenCommandType = QMetaType::type("TokenCommand"); - static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand"); - static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand"); + static const int informationChangedCommandType = QMetaType::fromName("InformationChangedCommand").id(); + static const int valuesChangedCommandType = QMetaType::fromName("ValuesChangedCommand").id(); + static const int valuesModifiedCommandType = QMetaType::fromName("ValuesModifiedCommand").id(); + static const int pixmapChangedCommandType = QMetaType::fromName("PixmapChangedCommand").id(); + static const int childrenChangedCommandType = QMetaType::fromName("ChildrenChangedCommand").id(); + static const int statePreviewImageChangedCommandType = QMetaType::fromName("StatePreviewImageChangedCommand").id(); + static const int componentCompletedCommandType = QMetaType::fromName("ComponentCompletedCommand").id(); + static const int synchronizeCommandType = QMetaType::fromName("SynchronizeCommand").id(); + static const int tokenCommandType = QMetaType::fromName("TokenCommand").id(); + static const int debugOutputCommandType = QMetaType::fromName("DebugOutputCommand").id(); + static const int changeSelectionCommandType = QMetaType::fromName("ChangeSelectionCommand").id(); if (command.typeId() == controlCommand.typeId()) { if (command.typeId() == informationChangedCommandType) @@ -186,8 +186,8 @@ void NodeInstanceClientProxy::writeCommand(const QVariant &command) } } else if (m_outputIoDevice) { #ifdef NANOTRACE_DESIGNSTUDIO_ENABLED - if (command.typeId() != QMetaType::type("PuppetAliveCommand")) { - if (command.typeId() == QMetaType::type("SyncNanotraceCommand")) { + if (command.typeId() != QMetaType::fromName("PuppetAliveCommand").id()) { + if (command.typeId() == QMetaType::fromName("SyncNanotraceCommand").id()) { SyncNanotraceCommand cmd = command.value(); NANOTRACE_INSTANT_ARGS("Sync", "writeCommand", {"name", cmd.name().toStdString()}, diff --git a/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp b/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp index eda6a565b1d..772b32ac04a 100644 --- a/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp +++ b/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp @@ -24,9 +24,9 @@ int main(int argc, char *argv[]) }; Row { - PushButton { text("-"), onClicked(minusClick, nullptr) }, + PushButton { text("-"), onClicked(minusClick, qApp) }, lineEdit, - PushButton { text("+"), onClicked(plusClick, nullptr) }, + PushButton { text("+"), onClicked(plusClick, qApp) }, Group { title("Splitter in Group"), Column {