Commit Graph

3443 Commits

Author SHA1 Message Date
Jarek Kobus
8dd46d0399 Various Plugins: Simplify return FilePath statements
Change-Id: Ia9efb86f722caca1492b577d51442f1f23b804b4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-08-02 08:19:23 +00:00
Eike Ziller
c4089a699e CMake/macOS: Fix framework paths with CMake >= 3.27
Previously the "compileGroups" > "includes" section contained paths to
frameworks, like "<Qt>/lib/QtCore.framework" which we use to add a
framework path of "<Qt>/lib" to the code model. These paths moved to a
new "compileGroups" > "frameworks" section in file-api in CMake >= 3.27,
so we need to read this section as well.

Fixes: QTCREATORBUG-29450
Change-Id: Ica685006d1373fdc3efee6029acf4a7f7e8528f3
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-02 05:55:24 +00:00
Cristian Adam
3c0899d736 Debugger: use TemporaryDirectory for CMake debugger
Hardcoding "/tmp" is not the best idea.

Change-Id: I9d5abd48bdf37d842d790db5ae5c4a7b994075e1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-28 11:55:31 +00:00
hjk
c326f049dc CMake: Prepare postponing formatter settings creation
This is still an overall quirky setup.

Change-Id: I7c1d22267bb76d434fe2f9b77ed8d0bfef5ac952
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-27 12:08:01 +00:00
Eike Ziller
a419670ff5 Build: Change plugin json.in files to CMake style
They were still using variables in qmake style.
Directly use CMake variables in the json.in files and remove the no
longer needed escaping of quotes.

Adds a fatal message if it detects the old style in a .json.in file for
easier porting.

Change-Id: I8de88d8db2da55781f0e9d72eda03f943723188e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-25 13:21:16 +00:00
Eike Ziller
355e8d133c Fix some warnings about unused things
Change-Id: I42bb514dfe1d6745b1469b508a4cfa576e17c31b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-07-25 07:26:58 +00:00
hjk
1c4f973365 ProjectExplorer: Replace the fromMap error return value
... by some out-of-band mechanism, keeping previous functionality.

The driving reason is to get the same fromMap signature as in the
AspectContainer base, however, the whole mechanism seems rather useless:
There are only a few places that actually ever could report errors,
in those places "moving on" looks ok, too, and these few places
are not conceptually different than a lot others.

Removal of this (new) mechanism is left for later.

Change-Id: Ibe7a0456bc3b84a84e942231f14446e783372d76
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-24 06:31:51 +00:00
hjk
53d06feecd ProjectExplorer: Change ProjectConfiguration::toMap signature
To match better with the rest, especially the base AspectContainer.

Change-Id: Ide0966cab3219800aa6b7b9e6012731a3fbe7a6f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-21 16:12:15 +00:00
Eike Ziller
626378de2d Merge remote-tracking branch 'origin/11.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/qtsupport/examplesparser.cpp

Change-Id: I2a0808261969e8c7cef7fae86d9027a155bf9b14
2023-07-19 16:10:37 +02:00
hjk
bedab22e63 Replace a few aspect.value() calls with operatpor()
Change-Id: Icaada671fe8dbe59d4f596da49476b3ec2137c25
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-19 05:14:13 +00:00
hjk
0db2beeff9 Cmake: Make line edit in formatter settings editable again
... and improve layout a bit

Change-Id: Ib1f7626259ca59190804faab5e2f453e8520de58
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-07-18 09:07:39 +00:00
hjk
433f8a3241 CMake: Remove an accidentally introduces second build dir aspect
Not quite harmless, as it was destroying persistent data written by
the normal one.

Amends b9cf021b8e.

Change-Id: Ie2775881535c4d19174177f443a4606acc1576de
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-07-17 14:03:33 +00:00
Cristian Adam
dc01c79203 CMakePM: Use staging dir only when selected
Fixes: QTCREATORBUG-29223
Change-Id: Ibc31b73ddda4f3906929ec1a4ff13eca84a704c8
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 13:22:45 +00:00
Eike Ziller
ac0796926d Merge remote-tracking branch 'origin/11.0'
Change-Id: Iaa647a44accc98ae84aa095d0bd5049588a92387
2023-07-14 14:51:22 +02:00
Jarek Kobus
5bcf289fce CMakeProcess: Remove unused function
Amends cd6e990de8

Change-Id: I407a26bb75bbd059b9bf7a0b546024700b738769
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2023-07-14 10:06:37 +00:00
Artem Sokolovskii
cd6e990de8 DAP: Add CMake debug to the debug panel
This commit introduces the capability to initiate
CMake Debug sessions directly from the debug panel
in the QtCretor.

Change-Id: I00245e0e14aded378e881c4049cdc41dd1fbd00e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 08:47:01 +00:00
hjk
f7afa52106 CMake: Use aspects more directly in CMakeBuildStep
Change-Id: Id12381556439ef6b3e56307a169830bb18da9003
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-14 07:25:06 +00:00
Jarek Kobus
47ac604aea AbstractProcessStep: Use task tree for all subclasses
Introduce AbstractProcessStep::runRecipe() virtual method
with the default implementation.

Task-number: QTCREATORBUG-29168
Change-Id: Iac75f4c38f8ee91ad8ac9324bb27881a3722911f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 06:48:58 +00:00
Jarek Kobus
0b2565a3e7 AbstractProcessStep: Get rid of done hook
Not needed anymore.
Remove emitting 100% progress on finish of CMakeInstallStep,
as that's done automatically by the task tree.

Task-number: QTCREATORBUG-29168
Change-Id: If93d989eeb0a551f00754c5d6ef7f180fdbabdd5
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 06:44:20 +00:00
Alessandro Portale
733279e017 CMakeProjectManager: Deselect "Stage for installation" for WebAssembly
There is no CMake install target for WebAssembly. Therefore, the "Stage
for installation" option needs to be deseleceted, like it is being done
for Android and iOS.

Amends: 2387e9e37a

Fixes: QTCREATORBUG-29293
Change-Id: I954dc492259b7211d3dc68047dbb6d7a8e6579b9
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 05:22:58 +00:00
Cristian Adam
81cf54f7cd CMakePM: Persist "Do not show again" for preset reload dialog
Was not persisted and would pop up every time.

Change-Id: I6fa6d7d57948a917f08ebc91382774355734f7a6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-07-13 12:18:39 +00:00
Jarek Kobus
2cc3c3b681 CMakeBuildStep: Employ task tree for running
Remove emitting 100% progress on finish, as that's
done automatically by the task tree.

Task-number: QTCREATORBUG-29168
Change-Id: I468fd2c12ffda4c051a46e586fc18214598269f9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-13 09:53:54 +00:00
Jarek Kobus
b37b94f0e5 AbstractProcessStep: De-virtualize finish() method
Provide a setDoneHook() setter instead. The hook is
introduced temporarily, as when all the subclasses
are transformed to use the task tree, the done hook
is going to be a part of the subclass' recipe.

Task-number: QTCREATORBUG-29168
Change-Id: Idbc0f8b8a32c8df2fa5ecb73ed1cbaedad99620d
Reviewed-by: hjk <hjk@qt.io>
2023-07-13 06:50:07 +00:00
hjk
69008e390c CMakeProjectManager: Use aspect more directly in CMakeInstallStep
Change-Id: Ibdd1fea42b93282b387693ea3d8cb155deeaed8a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-13 06:37:32 +00:00
hjk
a8a68b024a ProjectExplorer: Use less indirection for BuildConfiguration aspects
Change-Id: I6c219bc35edccd723f39e71d52b246060c1c424e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-10 15:35:03 +00:00
hjk
5f9408ee8d CMake: Move some functions from build system to build config
Less indirection.

Change-Id: I3a0a41c360b051cf0a3021d57d437fbde8f0736e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-10 11:50:42 +00:00
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
Eike Ziller
3d3c78dfc6 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: If3ada34dcc764fa1d0cce04fd343fb5a02c2fbaa
2023-07-10 09:29:51 +02: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
Marcus Tillmanns
d18768b53a CMakeProjectManager: Use more FilePath
Change-Id: Ifa3e754c224cd6ec315d49cd825aa78ac59b5ad9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-07 07:08:36 +00:00
Cristian Adam
e33b8137df CMakePM: Handle qml debugging for CMake presets
Fixes: QTCREATORBUG-29311
Change-Id: I437d008a3625156e6a42f2ecaee71744bd9098f6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-07-06 14:08:14 +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
Eike Ziller
609510c323 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	doc/qtdesignstudio/src/views/qtquick-designer.qdoc

Change-Id: I5d7ea23e356add0cbb2ad01ceb5e433377dc51c2
2023-07-06 09:49:11 +02:00
Cristian Adam
fe8c276d11 CMakePM: Auto detect generator when not specified in presets
Qt Creator would do a compiler probe for CMake presets when the compiler
was not set.

But the same needs to be done when the generator is not set. Otherwise
Qt Creator would set a different generator by default. On Windows is
"Ninja".

This is different from what CMake does from command line.

Task-number: QTCREATORBUG-28693
Change-Id: I96e917b11561a042f9476bad302f3f153e37bafd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-07-05 14:02:48 +00:00
Cristian Adam
6235d9b8cc CMakePM: use string form for architecture / toolset preset fields
Documentation mentions:

"Each may be either a string or an object" and "If no strategy field is
given, or if the field uses the string form rather than the object form,
the behavior is the same as 'set'"

Task-number: QTCREATORBUG-28693
Change-Id: Idd8cdffb94e9a943e0b133a63c628d9d8d54eb20
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-07-05 13:28:28 +00:00
Artem Sokolovskii
1fc0ca5277 DAP: Add CMake support to DAP engine
Added CMake support to the DAP engine in Qt Creator.
This feature can be enabled by setting the environment
variable QTC_USE_CMAKE_DEBUGGER. CMake debug session can
be started by clicking "Run CMake" or "Run".

Note:
Doesn't work with "Run debugging" in this patch.
Works only with cmake 3.27.0 and newer.

Change-Id: I756ea57f507aa4a6621ad62a8c0ef52c44a5185d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-07-05 06:59:49 +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
David Schulz
4743724d4c Editor: replace Utils::Text::Replacement with Utils::ChangeSet::EditOp for formatting
Removes the last usage of Utils::Text::Replacement with a more commonly used pattern.

Change-Id: I0912bf61388a58ddaba424380ec139f9aa15fc4c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-04 11:39:30 +00:00
Tasuku Suzuki
6e59fa4305 Remove unimplimented method declaration
Change-Id: Idea9e31ccca7de4a00a8cd9cde5c40491ae1dcbc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-07-03 15:00:38 +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
hjk
98bba063b6 Utils: Use FilePathAspect::setDefaultValue
... instead of StringAspect::setDefaultFilePath.

Closer to the intended uniform access.

Task-number: QTCREATORBUG-29167
Change-Id: I87df385ef98873a0955010149a9a9b09a5f29daf
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-30 09:34:26 +00:00
hjk
32dc43693f CMake: Use a FilePathAspect as base for SourceDirectoryAspect
Closer to its true nature.

Change-Id: I96b86690eb138814009aef0f06c87fca8451cfe9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-06-29 15:16:52 +00: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
04bb8c7b02 Remove some unused variables & includes
They are set and modified, but never read.

Change-Id: I6f21ae325e21513678f1534cd05e1a2470b9627b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-06-28 12:11:15 +00:00
Eike Ziller
dff9e1463b Reduce usage of app_version header
Most information is available via Q(Core|Gui)Application.
Add an AppInfo structure for the things that are not.

This avoids that the information ends up duplicated and
hardcoded in the plugins, which is not needed or desired.

Change-Id: I4d565e75c42a7b8facafa90c27096ea49359215d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-26 06:57:46 +00:00
Christian Kandeler
cf6bd7e012 Fix occurrences of the contains/insert anti-pattern
Introduce and make use of Utils::insert() for QSet with a return value
that indicates whether insertion actually happened.

Change-Id: I655e4bc3553b74fea5ae8956205e4d8070118d63
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-23 09:51:54 +00:00