Commit Graph

515 Commits

Author SHA1 Message Date
Eike Ziller
81f7325a0c macOS: Remove code handling Qt Creator running under Rosetta
Remove code that was added to handle the case of Qt Creator running as
an Intel binary on ARM Macs, which required some passing of flags to
qmake/CMake/LLDB.

Nowadays, Qt Creator can be built for the corresponding architecture
(and by default we provide universal binaries).

Partially reverts a71d725e46

Change-Id: I842f85b85a26d09cff72199ae86c602fd8f14e33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-07-29 10:50:28 +00:00
hjk
cba64c460b Use the new BaseAspect::addOnChanged in a few places
... and in some cases move it closer to the aspect setup. I kept
the original location in cases where the order possibly matters.

Change-Id: I4774ea355d0d1e3cf890676a84121195fca6d406
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-07-12 07:40:10 +00:00
hjk
495418d4c4 CMake: Simplify CMakeBuildSettingsWidget::kitCMakeConfiguration()
Change-Id: Ie64500c42128f5e38ebdd83b0853a016e36cfc0d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-07-10 09:21:53 +00:00
Cristian Adam
e2be8f9d16 CMakePM: Fix having duplicate CMAKE_CXX_COMPILERS entries
Do not apply the changes directly to the model, cache and then apply at
the right time.

Fixes: QTCREATORBUG-27005
Change-Id: Id099f21196900cd0e9787ac27887f2eec36f8045
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-27 16:01:19 +00:00
Cristian Adam
cc05c16377 CMakePM: Ask for a build configuration name for new configurations
Amends f866b03b19

This would do what the QMake build system does on new build types, it
asks for a name and uses that name in the build directory.

Fixes: QTCREATORBUG-26066
Change-Id: Iec5b4ace1e203affad718b42ec2bcbbc87aef51f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2024-06-25 15:30:46 +00:00
Cristian Adam
b66a800045 Revert "CMakePM: Set platform codegen and linker flags for GCC compilers"
This reverts commit 831b93905b.

Reason for revert: breaks Android and it looks like magic. For CMake one
should use a toolchain file. But this revert keeps the CMAKE_C|
XX_FLAGS_INIT parameters update / merging.

Change-Id: I1c3c61e4a9345a29e72db7f5f5a2d6e3fdba52f1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-11 09:52:22 +00:00
hjk
d308b86847 Utils: Centralize aspect macro expansion setup and handling
Let each aspect have a macro expander, and let aspect-owned lineedits
use this for expansion.

Change-Id: Ifa6f5a678cf81c169643e4145f41e69eafedeb93
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-10 06:31:20 +00:00
Cristian Adam
0fa8047f12 CMakePM: Transform a few raw C strings into constant literals
This way you can have code completion for the constant literals and not
do any accidental typos.

Change-Id: I1f9dc36327052fcda9575dddec909db93c4b225c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-05 13:14:02 +00:00
Cristian Adam
e04c727043 CMakePM: Don't remove QML debugging flag with the preset value
If a CMake preset has the CMAKE_CXX_FLAGS_INIT parameter defined, it
would override the QML debugging flag set before.

This patchset makes sure that both are present.

Change-Id: I2012567af04c2fa0b0097331c05d96770dd86503
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-05 13:13:14 +00:00
Cristian Adam
831b93905b CMakePM: Set platform codegen and linker flags for GCC compilers
If a GCC compiler has platform codegen flags they will be set into
CMAKE_C_FLAGS_INIT or CMAKE_CXX_FLAGS_INIT initial CMake parameters.

The linker flags are set they will be set into
CMAKE_EXE_LINKER_FLAGS_INIT, CMAKE_MODULE_LINKER_FLAGS_INIT and
CMAKE_SHARED_LINKER_FLAGS_INIT initial CMake parameters.

If the kit has a Qt the CMAKE_CXX_FLAGS_INIT value will merge both GCC
C++ platform codegen flags and the QML Debugging flags.

Fixes: QTCREATORBUG-24420
Change-Id: I066d30b816ae8575f615654bb85bd82a394f9737
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-04 18:32:57 +00:00
Cristian Adam
322944469f CMakePM: Add/remove CMake parameter for "Package manager auto Setup"
The CMake parameter is CMAKE_PROJECT_INCLUDE_BEFORE used in the "Initial
Configuration".

This commit will add or remove the above parameter in the "Initial
Configuration" list.

Previously, the parameter would have been added only on the first time.
Now with project CMake settings this is needed also for already
configured projects.

Change-Id: I7293032ef3e7e6e0ad0b51c68ef5fbe0cab48919
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-29 10:17:15 +00:00
Cristian Adam
1712402b35 CMakePM: Add project CMake settings support
This is useful if projects do not to have "Auto Run" CMake or want to
have Junctions enabled.

Change-Id: I4a636e7bf64fe2d29d15d39fe9aa46807684c716
Reviewed-by: hjk <hjk@qt.io>
2024-05-28 15:03:42 +00:00
hjk
971938421c Use LayoutBuilder V2
This puts the implementation introduced in acf1ecb47f into use, after
significant simplifications in the class hierarchy. CRTP is not used
anymore, and the new tag based dispatch is also used for Layout::addItem,
effectively reducing the number of different code paths.

The Lua based settings access is disabled for now.

Change-Id: Idb6d1a25675378757c5267bdb630bcd4c1f52d34
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-27 12:38:48 +00:00
David Schulz
bf41545468 ProjectExplorer: remove confusing function from Project
Change-Id: Ifaed5d8293dadd2ae3cfdab3b027434d4f8caa3e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-05-02 13:37:47 +00:00
Sami Shalayel
1e3750c5be qmlls: add checkbox for generating qmlls ini files
Add a checkbox to the qmljseditingsettingspage that generates qmlls
ini files by default for new projects.

If this checkbox is checked, then initial CMake configurations (when
enabling a kit for a project) and reconfigurations (when pressing the
"Re-configure with Initial parameters"-button) will set
QT_QML_GENERATE_QMLLS_INI to ON if QT_QML_GENERATE_QMLLS_INI was not
set yet.

Fixes: QTCREATORBUG-30394
Change-Id: I58f89558d25ef107e501bd67702f26554bd6aeaa
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-04-11 07:22:20 +00:00
Jarek Kobus
8bcc78a044 Various plugins: Fix some more C++20 warnings about [=] captures
Change-Id: If20aac4320c84096a07d67cc137886638286acf8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-06 08:34:44 +00:00
hjk
a615b236e5 CMake: Use a setup function for CMakeBuildConfigurationFactory
The class itself is still used by IosCMakeBuildConfigurationFactory.

Change-Id: I9fd979fc8e24c9f032b35c1f3444c28d06f86d0a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-29 16:29:53 +00:00
Cristian Adam
76a8966739 CMakePM: Refactor CMakeLists|Cache.txt as constants
Change-Id: I7165fa1d219a0c59bc519a9af1cd194414c4311c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-29 11:50:21 +00:00
hjk
27ef041d28 ProjectExplorer: Some more ToolChain->Toolchain renamings
Change-Id: I5cb2adf544a846f45f7fe7ce60f67b10ad100d91
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-12 08:14:59 +00:00
Alexey Edelev
4eedc4b2d0 Default the QT_USE_TARGET_ANDROID_BUILD_DIR value to TRUE
Set QT_USE_TARGET_ANDROID_BUILD_DIR to TRUE if Qt version
greater equal 6.8.0.

Change-Id: I051b7c1762858aac798eac167c491ccc68b65cf1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-05 06:45:14 +00:00
hjk
3bbda8f9da ProjectExplorer: Rename Tool{C,c}hainKitAspect
Change-Id: I74460b6402ab00f972c208023f03fac617982a11
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-27 13:35:28 +00:00
hjk
c28fb1fdbe ProjectExplorer: Rename ToolChain to Toolchain
Change-Id: Ibb520f14ff3e2a6147ca5d419b9351c50c141063
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-24 15:18:24 +00:00
hjk
6685f0255d Utils/all: Move mime constants into a central place
They are reasonably standardized, and generally usable cross-plugin,
so this can help to avoid a few cross-plugin compiletime dependencies.

Change-Id: Icb2b010c3e12dee69df54ab16f6f8e90d9cffba6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-08 09:59:26 +00:00
Cristian Adam
60de12efd2 CMakePM: clang-tidy fix for "performance-unnecessary-value-param"
Change-Id: Ia22d7c3fe6c29a5e0999145b6c4b281818dd72bf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 13:57:15 +00:00
Cristian Adam
45fb2c0986 CMakePM: Remove pointer check for null
The pointer contains the parent class passed with "this" and will never
be null.

Coverity-Id: 1568097 Dereference after null check (FORWARD_NULL)
Coverity-Id: 1568100 Uninitialized pointer field (UNINIT_CTOR)
Coverity-Id: 1568111 Dereference before null check (REVERSE_INULL)
Change-Id: I40e32d162689c749d498c4a63c073c0e336a3626
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-10-10 07:30:36 +00:00
Cristian Adam
4f26d802ca CMakePM: Remove support for extra generators
They are marked as obsolete in CMake 3.27 and will be removed in a
future version of CMake.

Fixes: QTCREATORBUG-29603
Change-Id: I6e5d36441d05b87ee4467d13781f53d4269636ad
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-14 10:30:06 +00:00
hjk
a475632c66 Utils: Make TreeViews use setUniformRowHeights by default
When applicable, the flag makes a significant difference in
performacnce. However is easily forgotten in cases where it
is applicable, and cases where it is accidentally used are
easily spotted visually. So arguably, opt-out is a better
default than opt-in.

Change-Id: I88aeb05b42533ba4e23c39573a3ddd016343cd55
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-05 07:24:21 +00:00
Cristian Adam
07ad848ea1 CMakePM: Replace QDir in CMakeBuildConfiguration
This allows remote support.

Change-Id: I12c991d584baa3762102b8a19179e732a31f192b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-31 14:23:10 +00:00
hjk
23149b27ab Utils: Introduce variantFromStore and storeFromVariant
These are functional replacements for
  QVariant::fromValue(QVariantMap) (or QVariant::fromValue(Store)) and
  QVariant::toMap() (or QVariant::toValue<Store>())

We will have a few code paths in the end that need to explicitly
operarate on both QVariantMap and Store (e.g. actual reading/writing
to keep format compatibility etc), so these can't in the end be
simple to/fromValue(OneType) but need an internal 'if' or such.

Change-Id: I954f3cb24fa8fe123162b72bbd25d891dd19b768
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-28 11:16:40 +00:00
hjk
d7d78df9da Plugins: And more Store and Key
After this one, is compiles with the opt-in macro. Not changed yet,
though.

Change-Id: I29a66ecb5daa71d0d97566b81fd9f47d92f6368a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 11:45:22 +00:00
hjk
8d0aa34bfc Plugins: A bit more Keys and Store
Change-Id: Iee55eeaa881dd9f2047fdbe95ad8d827f4ba34e0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 08:00:02 +00:00
hjk
5254765e16 ProjectExplorer: Re-organize KitAspect layouting related functions
Less obscure as it's fairly close to the standard pattern now.

Change-Id: I4680465fbdb9fb6a458c18ef0534e4d8a4a31d1e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-24 08:40:32 +00:00
hjk
6e307be365 Utils: Rename the new Storage to Store
Apparently that's what the young people on the web use for such a thing.

Change-Id: I75d5396ff3cb3c26efd6008b5f2261354c4f7896
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-24 05:56:57 +00:00
hjk
dc6b40a5c0 Use Utils::Storage instead of QVariantMap in a few places
Change-Id: I02833cf2bc3caaadc22ff93ae530e4aebe4c3868
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-23 14:30:50 +00:00
hjk
45e3fa1621 ProjectExplorer: Simplify KitAspect::addToLayoutWithLabel()
The parent widget was not used anymore.

Change-Id: I57bb024b770c01efc68bb722623bcc7fb565cfeb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-22 13:14:02 +00:00
hjk
4e23f2a6eb CMakeProjectManager: Hide kit aspect factory implementation
Also avoid re-instantiation of factories in the build configurations.

Closer to the setups of the other kit aspect(factories).

Change-Id: I1b74a68287b63ee94ff18106d3a00b23624a601b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-22 12:56:12 +00:00
hjk
4e0c4b0f23 CMake: Rename cmakekitinformation.{h,cpp} to cmakekitaspect.{h,cpp}
Follow up after renaming the contained classes.

Change-Id: I9393c367abdd4eac487e17676c98a357ff33c98c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-22 05:56:39 +00:00
hjk
aa25fdcc69 QtSupport: Rename qtkitinformation.{h,cpp} -> qtkitaspect.{h,cpp}
Change-Id: I12229e5e98b468101d32edd35be74bbda0921d89
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 08:59:52 +00:00
hjk
017d7c0e47 ProjectExplorer: Rename kitinformation.{h,cpp} to kitaspects.{h,cpp}
Change-Id: I069bddeb457366210d339edcbb8ffb359a40fab8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 07:31:03 +00:00
hjk
e9266f53ec CMakeProjectManager: Rename some of the KitAspect related classes
... and split out the static interface.

Change-Id: I28cdb2765a00d1bd19790f46a3b2b0da8690e929
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-11 07:00:37 +00:00
hjk
fde372b81e ProjectExplorer: Rename KitAspect related classes
KitAspect -> KitAspectFactory
KitAspectWidget -> KitAspect

KitAspect::createConfigWidget() -> KitAspectFactory::createKitAspect()

Possibly not perfect yet, but closer to what it does and is.

There will be follow-ups to rename derived classes.

Change-Id: I226f6f025f1e6462c348b68663f776f5a2e8c42d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-08-10 13:03:21 +00:00
hjk
f09b61651e Utils: Approach aspect update signalling more systematicly
This was pretty much ad-hoc so far. Now do the actual value proliferation
inside the aspect first and collect information on what changed. Signal
changes in the end centrally. At that time the aspect internal state is
consistent again.

Additional design desision implemented here: setDefaultValue and
fromMap/readSetting do _not_ signal, user code with unusual needs
has to check on its own.

Change-Id: I1e46282558e014f51933d1044a72bf5c67437ec5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-08 12:06:16 +00:00
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
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
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
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
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