Commit Graph

2771 Commits

Author SHA1 Message Date
Tim Jenssen
f8c99ebd9a Merge remote-tracking branch 'origin/9.0' into qds/dev
Change-Id: I02fd6f492c27d85b88af7ec8bc18ff62f2c6ed14
2022-11-09 16:41:12 +01:00
Alessandro Portale
657cc181fe CMakeProjectManager: Deduplicate string "-DQT_QML_DEBUG"
Change-Id: Ice9bc9b1ee17d477a484b9f4d630737f6633c06c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-08 10:52:03 +00:00
Marcus Tillmanns
129448d61d QmlJS: Fix Follow under cursor
When trying to jump to a symbol in a qml file the Qml Model may find
the location in a generated .qml file in the build folder.
QtCreator searches in all generated .qrc files to try and find
the source file so it can jump to it instead.

Previously not all auto-generated ".rcc" folders would be found
as only the folders of targets (executables) were searched.
Plugins or Static Libraries were not searched.

With this fix, all projects nodes are searched for the ".rcc" folder
and therefore also finds them for Dynamic / Static libraries and
plugins.

Fixes: QTCREATORBUG-27173
Change-Id: Ic51ac8fbc82c15785cbefd76787942a512ecf3db
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-11-08 09:54:10 +00:00
Tim Jenssen
40072fb5c7 Merge remote-tracking branch 'origin/9.0' into qds/dev
Change-Id: I5f72661f1fc54ff861e2cbbaa4cb32f867924c3b
2022-11-03 15:32:29 +01:00
Marcus Tillmanns
6936f23328 CMake: Fix settings display not updated
Fixes: QTCREATORBUG-28267
Change-Id: Icf2fb7e5d7a8cd44d7a61ade36be41106aba2138
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-27 13:11:29 +00:00
Cristian Adam
4fdbfe1641 CMakePM: Proper handling of relative toolchain files in CMakePresets
Previously it was only tested with absolute paths.

Change-Id: I3871da60f3f1b17ae4d2d4cfb69d1be60da1435b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-25 20:56:24 +00:00
Cristian Adam
fb94873765 CMakePM: Use Utils::Environment for Presets environment
Utils::Environment takes care of the case insesitivity of the key of
environment variables on Windows.

Change-Id: I624340d30c6b170b5d0a86791f26a4841a0b2fb7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-25 20:56:15 +00:00
Cristian Adam
83e77d71a8 CMakePM: Expand cache variables for the preset probe
This way the CMAKE_PREFIX_PATH set to $env{HOME}/Qt (Linux) or
$env{SystemDrive}/Qt (Windows) would work as expected.

Change-Id: I03a9102d6d1da2a8740cab738577c47c44166c6c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-25 20:56:06 +00:00
Cristian Adam
ec4d96a14b CMakePM: Accept broken kits for CMakePresets
For CMakePresets if a preset is broken we should not create a preset kit
for every build type.

Instead reuse the broken kit created by the first build type.

Task-number: QTCREATORBUG-28295
Change-Id: I038fbb23817834f59ac73ccd2f9953f1a412b656
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-25 20:55:08 +00:00
Cristian Adam
7dfc7c627b CMakePM: Allow presets without generator specified
This allows presets that do not have a generator specified to proper
work.

On Windows CMake will detect "Visual Studio" as generator. This change
sets the generator and the architecture values accordingly.

Change-Id: I943e082430445c4b16cf9eaf4ae5ae2500b2bd2b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-25 20:54:59 +00:00
Cristian Adam
869597884d CMakePM: Merge cacheVariables, environment for inherited presets
cacheVariables, environment (and others) collection fields need to be
merged when having inherited presets.

Fixes: QTCREATORBUG-28360
Change-Id: I3d2b84355fad9ffa2dc4629ece7d42f7b482a859
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-25 20:54:49 +00:00
Tim Jenssen
aa33927651 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
	src/plugins/qmldesigner/components/stateseditornew/propertychangesmodel.cpp
	src/plugins/qmldesigner/components/stateseditornew/propertymodel.cpp
	src/plugins/qmldesigner/qmldesignerprojectmanager.cpp
	src/plugins/qmldesigner/qmldesignerprojectmanager.h

Change-Id: Ib029a830ee99190bc4ea2ad75d9300bfa86b42d9
2022-10-25 19:02:15 +02:00
Christian Kandeler
13f40f5471 Utils: Add sorted() function
For simpler calling code.

Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-25 14:29:45 +00:00
Cristian Adam
bf83f63a13 CMakePM: Add installDir CMakePresets support
Is part of CMakePrests v3, and slipped at the implementation time.

Task-number: QTCREATORBUG-24555
Change-Id: Id3ce90c0a979d44287fc03ae1dd49a64e964cdf2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-21 13:09:35 +00:00
Cristian Adam
430ff621aa CMakePM: Use parent environment for $env{macro} expansion
Now the code takes into consideration the parent environment for
$env{macro} alongside the "environment" presets values.

Task-number: QTCREATORBUG-24555
Change-Id: I644618b0a6f866fd65a4109ee63b1f5bfcd4164d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-21 13:09:20 +00:00
Marcus Tillmanns
36d7dcb6b2 CMake: Improve styling of cmake buildconfiguration
Shortens the "Run CMake" button and the cmake variables
tab header to make them easier to read on wide monitors

Change-Id: I2579a8fa1c2899ae94f9c4a72c4188dc61ecd5f9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-20 07:56:02 +00:00
Leena Miettinen
7c9d1ef516 UI text: Fix UI text to follow the guidelines
- Fix typos
- Replace "options" with "preferences"
- Fix capitalization
- Remove "please"
- Do not use contractions

Task-number: QTCREATORBUG-28334
Change-Id: Ie029eae435634aa2fb354e173fa107af72f7b025
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-20 07:38:32 +00:00
Cristian Adam
1c51dc1adf CMakePM: Do not use systemEnvironment() for CMakePresets
This doesn't mean that CMakePresets will work with a remote project, but
at least it avoids Environment::systemEnvironment() usage.

Change-Id: I17081c747d32e50224ac74507d3aa336ff5c8948
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-10-19 10:08:06 +00:00
Cristian Adam
23092b57b8 CMakePM: Use filePath().deviceEnvironment() to find ninja
Amends 45ec26783f

Change-Id: I05b52295841d60ff693d6e7b12c9e4ceaf0f09eb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-10-19 09:32:23 +00:00
Marcus Tillmanns
f7a2132598 CMake: Don't filter out new keys
Previously, if you have a filter set in the CMake Settings
variable list, adding a new one would immediately hide it,
as the text filter hides the "<UNSET>" key. This made it look
like the adding failed.

With this change, new Variables are always shown so
they stay editable to user.

Change-Id: I9c2eb7f9983b23e1cd3aa50f589142551caaf56f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-18 14:29:54 +00:00
hjk
4266f612e6 Utils: Rename FilePath::relativePath() to relativePathFrom()
Hopefully less confusion about the direction.

Change-Id: I61727d6c4d19e0dfe46f24ff24f5d90f9835d05c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-18 13:41:24 +00:00
hjk
d47a72e26c CMake: Use the OS of the source directory as ${hostSystemName}
In case of building on a remote system  CMake considers this remote system
as host.

Change-Id: Ifb9d0b2a2c4c49ba4ee009795f5b432c7b951e0d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-18 13:26:01 +00:00
hjk
e9ed3d6d05 RemoteLinux: Allow adding Qt to LD_LIBRARY_PATH
When running on the remote build device. And make it work with CMake.

Change-Id: If25bef8ab836c1d59a586116b3c3447a29c4e7e8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-18 11:24:15 +00:00
hjk
ec430787e5 CMake: More FilePath in Deployment data
Change-Id: I898a621a34558a28d4688a33aeb9bb9148df6901
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-14 13:01:15 +00:00
Cristian Adam
45ec26783f CMakePM: Search after ninja also in system environment
CMakePM was setting the default generator to Ninja if the ninja
executable was set in the build environment.

This had the side effect of having to instantiate the build environment
for Visual C++, which meant running vcvars.bat files. This operation can
be costly if clink is also installed in the system.

This way the users that have ninja installed via choco, or manually set
it path, will not be affected by this delay.

Note that this only fixes the issue for the first start of Qt Creator
with new settings.

Some number from my machine:
- with clink 21s
- without clink 10s
- with this patchset 4s

Task-number: QTCREATORBUG-27906
Change-Id: I74d19b08211d93b3962a8877b49a58089310fbd6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-14 08:11:51 +00:00
Christian Kandeler
a34125ae11 CMake/qmake: Fix target triple for iOS targets
Neither cmake nor qmake know the full iOS compiler command line, so we
have to construct the target triple for the code model ourselves.

Fixes: QTCREATORBUG-28278
Change-Id: I6cac06f340e9388de5c86509a8df4ac00eef87cd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-13 13:28:52 +00:00
Alessandro Portale
e0832ce7fc CMakeProjectManager: Default spacing in CMakeBuildConfiguration UI
Change-Id: Ida08086c4632d28f5c79e6c0351bf36125afee36
Reviewed-by: hjk <hjk@qt.io>
2022-10-13 09:09:51 +00:00
hjk
35d0e9dea8 CMake: Make configure environment optically part of configure step
Change-Id: I1b246acb2a057e624f7808d385a2d33c716d535d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-13 09:05:10 +00:00
Orgad Shaneh
da0cb254b2 CMake: Support Build File also from header files
Fixes: QTCREATORBUG-26164
Change-Id: Iaa2fdd34cffad07be668ca7142a8ffa2c373d325
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-12 17:28:49 +00:00
Cristian Adam
c1667f9bea CMakePM: Allow default build configurations for presets
Restrict the build types only if CMAKE_BUILD_TYPE or
CMAKE_CONFIGURATION_TYPES cache variables are set.

Change-Id: Ib88dcd5d4a0fca86f86e95815edff1116f896324
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-11 11:21:46 +00:00
Cristian Adam
f84bdee045 CMakePM: Allow presets without buildDirectory
CMakePresets v3 relax the requirement of having the buildDirectory
specified.

This way Qt Creator should use its own mechanism of specifying the build
directory.

Change-Id: I6ba69e6a03cdc058e7b8fa540a6fc564356aba63
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-11 11:21:41 +00:00
Cristian Adam
05acf3e6f4 CMakePM: Do not display duplicated build paths for presets
If we configure a project with presets, build all the configurations,
then delete the CMakeLists.txt.user file to re-configure the presets, we
shouldn't get two entries in the initial configuration dialog.

Change-Id: I9bb234aa54fcce193dbd07dd3aa77e91f639b179
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-10 14:48:28 +00:00
Cristian Adam
213c879882 CMakePM: Skip default build types for CMakePresets
If a preset has a build directory set, that build directory and build
type should be displayed in the initial configuration dialog.

Change-Id: I884471cb4d482c92ab091a4043d642828318b4d2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-10 14:09:04 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
0d13cfe652 CMake: Remove the restriction that the reply file cannot be remote
It would be remote on "real remote" builds.

Task-number: QTCREATORBUG-28242
Change-Id: Ic37e5c6ec30064aec825d2322d25843a526b6ac4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-07 09:49:06 +00:00
hjk
0e3d1064e6 CMake: avoid running into some code path that breaks later
When trying to configure a CMake project on a remote linux device,
there's currently PATH=/some/local/dir/for/ninja added on the ssh
command line, which won't work with the remote cmake.

Change-Id: I97adb58e4c8b33f74edcc37a7b2cfb00c764b829
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-06 14:59:10 +00:00
Marcus Tillmanns
8d80623a0f CMake: Delay restoration until devices load
If the devices have not loaded yet, trying to restore
a remote cmake will result in errors.

Change-Id: I08a802441d64b203388334e5cbb6b962d1f0d213
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-06 05:16:36 +00:00
Cristian Adam
ab7a472b94 CMakePM: update CMakePresets macro replacement function
Moved to a handcrafted function instead of using regex.

This way the Visual C++ Ninja only preset can be processed.

Change-Id: I9b303ee1765db05544d81db7d3b8d9e5223f5f42
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-05 17:54:35 +00:00
hjk
09fb8d403b CMake: Use correct device environment for remote cmake binaries
Change-Id: Id2fccab7f2d051406b0f2b0bbf3c118198f6ed32
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-04 10:47:00 +00:00
hjk
3b84a408df CMake: Allow parser to run remotely
Change-Id: I3953d459177790fd652ab69c083b0dd0f1d29031
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-04 10:46:51 +00:00
hjk
efbab2e7c4 CMake: Be a bit more specific on what is not reachable
Change-Id: I5d521a9562d36850c264e1af48b46e16c642fde9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-30 15:31:16 +00:00
Jarek Kobus
5ab100a2b9 CMakeProjectManager: Limit the usage of std::make_pair
Make the code less verbose.

Change-Id: I8dc194f0cb4ed38c4c117482a7011019444edc40
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-30 15:12:34 +00:00
Cristian Adam
ee4c998ff3 CMakePM: Add supprot for CMakePresets version 3
This includes Condition and toolchainFile

https://cmake.org/cmake/help/v3.21/manual/cmake-presets.7.html

Task-number: QTCREATORBUG-24555
Change-Id: I1026390af67b2be1aa0c3b02b654fc19442d3c89
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 08:34:07 +00:00
Cristian Adam
45a275e054 CMakePM: Use architecture and toolset for project import
This fixes issues with Visual C++ generator, which needs the right
parameters to pinpoint the right compilers.

Also use CMAKE_TOOLCHAIN_FILE for qmake detection.

Change-Id: I6edc84c7ed1a892fbc5545ff61dc06ac20720f0a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 08:34:00 +00:00
Christian Stenger
58a4cd0804 CMakePM: Fix nullptr access
Amends 1b1fc43954.

Change-Id: Idfcf5bb2c58f37f366cb739475c7ba2d56d76e48
Reviewed-by: hjk <hjk@qt.io>
2022-09-30 07:11:24 +00:00
hjk
ab4c9b9679 CMake: Move to Tr::tr
Change-Id: I169da93b5184351cb915d4c198fd33318fcfe06f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 06:56:21 +00:00
Marcus Tillmanns
1b1fc43954 CMake: Convert paths to device
The values coming from a CMakeConfig do not contain
the device they are relative to.
This transforms the FilePath to be relative to the device
that the cmake executable was run on.

Change-Id: I7bfdf065ddb4acfc751ac6456f1c32398393e2ad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-29 14:04:39 +00:00
hjk
55ed34ced8 CMakeProjectManager: Use QList in PresetsData
Less impedance when interfacing the rest of the code.

Fixes

     warning: comparison of integer expressions of different signedness:
     ‘std::vector<....>::size_type’ {aka ‘long unsigned int’} and
     ‘qsizetype’ {aka ‘long long int’} [-Wsign-compare]

Change-Id: If5e1e770e2ed170aa4259963fa7ca0d6642190d9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-29 10:44:34 +00:00
Eike Ziller
a254a9ba54 Merge remote-tracking branch 'origin/master' into work
Change-Id: I2235a55a599aaeca5d2b5377300a044b66c17da9
2022-09-29 12:03:13 +02:00
hjk
cfc9f6d2f3 CMakeProjectManager: settings page code cosmetics
Change-Id: I657fa72d5b625877dc1deec229f6f5c7c16358fd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-29 07:55:07 +00:00