Commit Graph

466 Commits

Author SHA1 Message Date
hjk
dbdd6a0701 CMake: Pass CMakeBuildConfig to the settings widget
... instead of the build system. Less indirections overall.

Change-Id: I59b2fd4508b24a72357426439cac7fbd563e05bf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-10 11:50:10 +00:00
hjk
b9cf021b8e CMakeProjectManager: Use aspects more directly in build configuration
Change-Id: I35b9a31c158cac8eccb44ffb3f4e2d21d8183b8b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-10 11:48:30 +00:00
hjk
3e155919eb CMake: Use current pattern to access main settings page
Change-Id: I95c556bebe1d583879b6702f727d9a859b9a4bcb
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-07 12:57:27 +00:00
hjk
91513a53dd Utils: Make aspect settings access implicit
Generally, aspects should use fromMap/toMap, but some older pages
use {from,to}Settings with always the same ICore::settings().

To make that less intrusive on the user code side, make that globally
implicit.

Task-number: QTCREATORBUG-29167
Change-Id: I29a8e23a31eb8061bb143e93931a07c6741eb7f9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-07 09:02:29 +00:00
hjk
e75b81b0a8 QtSupport: Use current aspect ctor pattern for Qml related aspect
Task-number: QTCREATORBUG-29168
Change-Id: I3779ed4075dc98ccafc2490009d1217e908ad83c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-07 07:55:32 +00:00
hjk
fd83aa0bf7 CMake: Don't guess at build config when not needed
Change-Id: I0d7fb0a25103d2cf5bfb9b2d54bae18a91010c49
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-06 13:53:38 +00:00
hjk
8e257dca2c Utils: Replace StringAspect::setFilePath()
... by FilePathAspect::setValue().

Closer to the intented uniform API.

Task-number: QTCREATORBUG-29167
Change-Id: Ife26046eaeef2e49108e42a31a2d32e453883e3c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-04 11:41:31 +00:00
Eike Ziller
26e96bfad8 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	src/plugins/debugger/debuggeritemmanager.cpp

Change-Id: I9d99d13feff9315f52eacbd84857c63cb69bf804
2023-07-03 10:24:09 +02:00
Cristian Adam
6b6b1198dd Utils: Fix inverted logic for checkableDecider
`BoolAspect::checkableDecider` was used only in CMakeProjectManager for
askBeforePresetsReload and askBeforeReConfigureInitialParams.

Now the checkbox with "Ask before presets reload" would also match with
the display of the message box.

Change-Id: I45fc7a977dbeb13df051375bd3dac36e7be7bdc4
Reviewed-by: hjk <hjk@qt.io>
2023-06-29 14:59:07 +00:00
hjk
379e7f906e Utils: Rework aspect implementation
This avoids some repetition and could be a step towards
having type storage in (or rather accessible from) the base,
so we can have aspects for more complex data (treemodels...)
that are not easily converted to QVariant.

Change-Id: I9797b3d5646195705212db1830d2b415291ac651
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-29 11:25:44 +00:00
Eike Ziller
0f9b118776 Merge remote-tracking branch 'origin/11.0'
Change-Id: Ib798dc9922c01b7667388ca03d3a248610f73028
2023-06-20 10:36:06 +02:00
Eike Ziller
3a57a1a291 Merge remote-tracking branch 'origin/10.0' into 11.0
Change-Id: I909bf27bd6d43eb74ae61b15a61467a4a7e0558e
2023-06-20 10:12:59 +02:00
Eike Ziller
f88db30319 Merge remote-tracking branch 'origin/11.0'
Change-Id: Ibb433d3e1ea2c0632dd2f710c8ec995de7599978
2023-06-19 10:08:56 +02:00
Alessandro Portale
850f1ce66c Android: Don't pass duplicate ANDROID_PLATFORM to CMake
This makes sure that one unique argument "-DANDROID_PLATFORM:STRING=..."
is passed to CMake. An entry in a kit's CMake configuration has the
precedence over the ANDROID_PLATFORM defined by Qt's build system.

Fixes: QTCREATORBUG-29112
Change-Id: I1c4d80be9ddfc7a00a5a7eff476497f08d87b741
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-16 09:30:52 +00:00
Cristian Adam
64cd1df74b CMakePM: Add Qt SDK ninja to configure environment
Fixes: QTCREATORBUG-29032
Change-Id: I1aebd11ba85ad6a363ecf1ab6406cdec20753e9d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-16 09:10:52 +00:00
hjk
87a9345398 CMakeProjectManager: Remove compatibility code with < 4.13
This hunk was added as part of 01b0d4f8f5 in 2020.

Change-Id: I3b520005dc2462397ddfb1a2f6671603131ddced
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-06-13 14:54:55 +00:00
hjk
d740a355bb Utils: Rework CheckableMessageBox
Remove function overloads, thes are hard to read, to use and to extend.
I'd even argue this should be a plain default ctor and a few setters +
exec(), pretty much like Process::start() nowadays.

Move "decider" magic into a structure that can be filled ad-hoc outside
checkablemessagebox.cpp paving the ground for:

...removing  aspect dependency from CheckableMessageBox, Instead, add a
convenience function to BoolAspect.  Arguably, the latter is not needed
and could be done on the user side.

Use pointers instead of mutable references for in-out parameter.
Makes the "specialness" visible on the user side.

Pass ICore::settings() centrally as done elsewhere to reduce line noise
on the user side.

Change-Id: Ibb366353d1ea35401723fd05ce05672617a0a8fd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-22 06:40:13 +00:00
hjk
6f31d87444 Use more FilePathAspect
Change-Id: Ib348df1460f8610607251498b07010df58d51ddf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-19 15:07:17 +00:00
Eike Ziller
8e8ebc8f88 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	coin/instructions/build.yaml

Change-Id: I697b0107e75c6259989247de2180437d7987ff37
2023-05-17 14:55:02 +02:00
Marcus Tillmanns
1fc2459b62 Utils: Unify CheckableMessageBox and make it look more native
Change-Id: I5690c16f38cfd2058e01441283bec28d44cadf75
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-17 08:01:13 +00:00
Cristian Adam
62e9a0bec1 CMakePM: Stretch the CMake parameters column on resize
Makes sure that the CMake parameters columns are properly stretched when
Qt Creator window is being resized or maximized / restored from
maximized state.

Fixes: QTCREATORBUG-27257
Change-Id: Ifb4d439fb758dcc5b2593be917ba35e9c79f2840
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-12 12:07:31 +00:00
Cristian Adam
8854f53a42 CMakePM: Fix duplicated CMake presets kits
QTC_KIT_DEFAULT_CONFIG_HASH was introduced in order to match the
previous CMake presets kits.

This would hash the Qt and the C/C++ compiler paths.

Unfortunately on Linux CMake would pick "cc" and "c++" by default,
whilst Qt Creator uses "gcc" and "g++". The compilers would match from
the Qt Creator point of view, but the hash values would be different.

On mac there is a similar issue with compiler launchers.

This patchset fixes this by removing the hash and fixes also the issue
of allowing broken CMake presets kits (without any compilers), which
were the reason for introducing the hash key in the first place.

Fixes: QTCREATORBUG-29075
Change-Id: Id8dc081febba7bc7023c98055afc6ebfcdc55542
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 15:19:44 +00:00
hjk
99f7679564 Layouting: Make aspects operate on parent items, not LayoutBuilder
LayoutBuilder is meant to be an implementation detail nowadays.

Change-Id: I777ab934d3d405873e819eeddd27428d8c652f9a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:28 +00:00
hjk
50084f6b0e Layouting: Handle attach types via setter
Change-Id: I862f5cd109db3582b4f029787ec0cded2da39ce6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:19 +00:00
Christian Kandeler
02d86516c7 ProjectExplorer: Optionally show run environment in app output pane
Fixes: QTCREATORBUG-28427
Change-Id: I1022a377d3728ad5e91fa62514082110b86db9f4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-26 09:11:53 +00:00
Eike Ziller
c9696fbabb Merge remote-tracking branch 'origin/10.0'
Change-Id: I8b36c1812b61dbe08fe3e7930f950e6b8e8a7079
2023-04-24 08:52:35 +02:00
Eike Ziller
5125ccf03f Merge remote-tracking branch 'origin/9.0' into 10.0
Change-Id: Ifbb14e33104b39de8ca2e1495301a53e71496ef9
2023-04-24 08:10:39 +02:00
Thiago Macieira
d1d893f098 Fix dangling references, found by GCC 13
Lifetime extension via const-ref only applies to functions that return
by value. For those that already return by reference (such as
QList::constLast()), no extension happens and we end up with a dangling
reference.

cmakebuildconfiguration.cpp:1473:25: warning: possibly dangling reference to a temporary [-Wdangling-reference]
cmakebuildconfiguration.cpp:1473:61: note: the temporary was destroyed at the end of the full expression ‘ProjectExplorer::BuildStepList::steps() const().QList<ProjectExplorer::BuildStep*>::constLast()’

Change-Id: I3b169860d8bd41e9be6bfffd1757167b7348be9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-04-20 14:29:31 +00:00
Eike Ziller
4e6877753a Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/android/androidrunnerworker.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp

Change-Id: I1628528dbc0ffe874b49bbe022da5933b1348057
2023-04-18 12:53:45 +02:00
Cristian Adam
bbe61a965d CMakePM: sanitize preset initial configuration values
The task-number below has a sample where CMAKE_C|XX_COMPILER was set to
"cl.exe" and the CMAKE_PREFIX_PATH was set to "C:/Qt//6.5.0/
msvc2019_64".

These values would cause "red" values in the CMake configuration, which
is not that nice.

This patchset will make sure that everything is nicely configured.

Task-number: QTCREATORBUG-28982
Change-Id: I21289d1936ef075ce02364fc675709c52c76c3ed
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-17 15:03:59 +00:00
Marcus Tillmanns
ca0bee902f ProjectExplorer: Create BuildDirectory on device
The BuildDirectory is now assumed to be on the build device.

The default build directory template path is resolved against the
project path mapped to the build directory.

Change-Id: Ie1d147d135e9e551f2ac46cbec583374d524d2d7
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-04 12:17:49 +00:00
hjk
305ccfe259 Utils: Replace FilePath::onDevice() by new FilePath::withMappedPath()
Basically a.onDevice(b) == b.withNewMappedPath(a), matching the order
of b.withNewPath(a).

Whether the (curretly docker-specific) path mapping is useful /there/, and
whether some of the calls are needed at all is dubious. I added some
FIXME and changed a few cases directly.

Change-Id: I7514736ce922f632f1f737bc496f6783389a42b6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 06:56:55 +00:00
Eike Ziller
0d8d4322b4 Merge remote-tracking branch 'origin/10.0'
Change-Id: Ie591b7130b33a042509e56701384f8ff4d9cb7f8
2023-03-16 11:57:01 +01:00
Cristian Adam
60e03d4805 CMakePM: Do not pass QTC_KIT_DEFAULT_CONFIG_HASH to configure
QTC_KIT_DEFAULT_CONFIG_HASH is used to match CMake presets kits and
should not pass to the CMake configuration.

Change-Id: I27caedf03f94c1e864f16d1f735e2edbabbfe871
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-14 18:03:53 +00:00
Eike Ziller
3043f4bba9 CMake: Fix leak and crash
The crash could be reproduced by opening a project, clicking the "Kit
Configuration" button in the build configuration, closing that dialog,
opening it again, opening the settings from the "Manage" button for the
CMake tools, and closing the settings dialog.

The "KitAspectWidget"s are not really widgets, and by default do not get
a parent, or are otherwise lifetime managed. When "they" are added to a
layout, actually only their widget members are added to the GUI. When
opening and closing the "Kit Configuration" dialog, the widgets were
deleted, but the KitAspectWidget instances were leaked and lived on, the
CMakeKitAspectWidget referencing a now deleted QComboBox, and still
being connected to the CMakeToolManager's signals, which subsequented
crashed when these were sent.

Fixes: QTCREATORBUG-28740
Change-Id: I36db3b6596ef21cc01dc877bca92b9961c0606b9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-13 12:28:49 +00:00
hjk
5d21da74f9 Utils: More explicit host os use to make it stand out
Quite a few of the uses are actually wrong, but are better visible
now and therefore more likely to be fixed.

Change-Id: Ia51f7d6eb1b2d3a9c9f73d67dabacfd227c44b15
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-07 15:53:18 +00:00
Eike Ziller
87ede95b5c Merge remote-tracking branch 'origin/10.0'
Change-Id: I7bd186df0bfae7906e980e9c2c811f8dcf29750d
2023-03-02 10:17:58 +01:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +00:00
Cristian Adam
cdee94d641 CMakePM: Ensure Initial Parameters values on build config Clone
Fixes: QTCREATORBUG-28759
Change-Id: I8d7fa476ff487cf4bf5005f1ccfec65ffc59ed1c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-28 11:47:48 +00:00
Alessandro Portale
64aaf66c3b Proliferate Tr::tr in various places
This changes several tr() calls which were either missed during Tr::tr-
ization or were added later.

Found with regular expression: (?<!(Tr::)|([\w]))tr\(

Change-Id: I1c0c03589e941614a7a8449ecfebc7d2cad396c3
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:19 +00:00
Cristian Adam
a6ccfb09e5 CMakePM: Copy auto package-manager to ${buildDir}/.qtc/ directory
By copying the ${IDE:ResourcePath}/package-manager to
${buildDir}/.qtc/ the problem with hardcoding paths
to old an Qt Creator version can no longer occur.

This also fixes the issue with remote projects by reffering
to the code residing on the host.

With the above issues fixed, enable "Package manager auto setup"
by default.

Change-Id: Ia49654a3b9059f83886e64d065019b2d55e9299c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-02-08 16:17:49 +00:00
Cristian Adam
83a86bc4fe CMakePM: Reuse EnvironmentAspect for CMake configure environment
EnvironmentAspect is used in the Run configuration page.

For a configuration not using presets the "Build Environment" will be
used by default. This is the pre Qt Creator 9 behavior.

With presets "System Environment" is used, which allows the environment
sepparation of configure and build steps.

Fixes: QTCREATORBUG-28513
Change-Id: Ie65c0a5ac67355642460fca9fc618a1d29f4b1bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-24 13:24:23 +00:00
hjk
87c3f08e52 CMake: Move settings storage closer to class implementation
Simpler in use.

Change-Id: I8cc929001035974b9b73566b206410bfd77f73a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-23 14:49:45 +00:00
Eike Ziller
561b815d7b Merge remote-tracking branch 'origin/9.0'
Change-Id: I73396bcd07852ff5e01d73b06ebd64ab6af802e5
2023-01-18 10:02:35 +01:00
Tasuku Suzuki
ae59898aad CMakeProjectManager: Override 'Open Terminal' func to open build dir
88eda2322b did it for BuildEnvironmentWidget

Change-Id: I708dc8756564fb6aef85421e2e4663a29a7ffdd6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-17 15:28:45 +00:00
Eike Ziller
9256340e5b CMake: Fix missing path to Ninja from Qt installers
In the configure environment for MSVC toolchains.
The MSVC toolchain actually overwrites the PATH environment (triggered
via kit()->addToBuildEnvironment(result)), which it shouldn't.
But this is a minimal fix for Qt Creator 9.0 that also is in line with
what BuildConfiguration::baseEnvironment() does.

Fixes: QTCREATORBUG-28685
Change-Id: I0cb8e3c84419403672175bd581c16d90902e23ba
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-16 07:43:38 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Eike Ziller
371dcc3f26 Merge remote-tracking branch 'origin/9.0'
Change-Id: I58ff80e0be838ef5f149c091b8f74cda415ed53f
2023-01-02 11:19:06 +01:00
Alexey Edelev
803fb4ce77 Replace ANDROID_NATIVE_API_LEVEL with ANDROID_PLATFORM
ANDROID_NATIVE_API_LEVEL is not handled by the android toolchain files
starting the NDK version r23b. We should set ANDROID_PLATFORM instead,
to specify the NDK platform version, that exists in all NDK versions
supported by Qt. Also the ANDROID_PLATFORM variable expects the
'android-xx' format as a value, so avoid cutting the 'android-' prefix
when adding the value to the CMake configure string.

Fixes: QTCREATORBUG-28624
Change-Id: Idd4ba472e46982162e5ad74e9fc6868e50e3b434
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-12-23 17:10:13 +00:00
Jarek Kobus
d0e24654f6 CMakeProjectManager: Pass context object to lambda connections
Remove some unneeded lambda () brackets.
Remove some unneeded lambda return type specifiers.

Change-Id: I9695367d66a151f2611554b9fe5897c1bac7ef5c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-08 15:28:50 +00:00