Commit Graph

37 Commits

Author SHA1 Message Date
Christian Kandeler
b6299edf1f ProjectExplorer: Factor out function to compare toolchain suitability
... and use in ToolchainKitAspect in addition to KitManager.

Change-Id: I4c9221735a660697baab667877cc335ee0ee3e78
Reviewed-by: hjk <hjk@qt.io>
2024-08-08 14:47:30 +00:00
Christian Kandeler
077de5aab6 ProjectExplorer: Handle registering of auto-created bundle toolchains
... in the bundle itself, whenever possible.
It's very annoying to have to add this stanza in all places where
bundling takes place, and it's also easily forgotten, introducing memory
leaks.
This also nicely self-documents the expectations of the calling code as
to whether new toolchains can or cannot be created in the given context
as a side effect of bundling.

Change-Id: I78d2d4cdfc1010568f61f201b0d930b01f79a88b
Reviewed-by: hjk <hjk@qt.io>
2024-08-08 14:34:47 +00:00
Christian Kandeler
9cf9e0aa34 ProjectExplorer: Improve ToolchainKitAspect::setup()
- Use toolchain bundles.
- De-obfuscate the code.
- Add explanatory comments.

Change-Id: I19f4b5fde317ffabf06c762e1987b0314c52e646
Reviewed-by: hjk <hjk@qt.io>
2024-08-08 12:33:15 +00:00
Christian Kandeler
5d0aebcbc7 QtSupport: Use toolchain bundles in QtKitAspect
Change-Id: I260d511c13255b156e35e70d7ebb08d78e23e23b
Reviewed-by: hjk <hjk@qt.io>
2024-08-08 09:00:58 +00:00
Christian Kandeler
676a462d5d Docker: Improve Kit setup
- Use toolchain bundles, ensuring compatible C/C++ toolchains
- Try harder to match Qt and toolchains

Change-Id: I8739a5e1e75d08df4346d51cb0ee7704ca072489
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-08-06 11:54:20 +00:00
Christian Kandeler
020883c47f ProjectExplorer: Stop pretending that C and C++ compilers are unrelated
Motivation:
  a) It was ridiculous that when users wanted to manually
     add a new toolchain, they had to do the entire setup twice.
  b) It was equally weird that users had to take care to choose
     matching toolchains when setting up a kit, or indeed that it was
     even possible to mix random toolchains in the first place.

User-visible changes:
  - The "C" and "C++" categories in the toolchain settings page have
    been merged into a single "C/C++" category.
  - When adding a new toolchain, the "C" and "C++" sub-menus are gone.
    Instead, the toolchain config widget offers two path choosers if
    the respective toolchain type supports C and C++ compilers.
  - By default, the C++ compiler file path is derived from the C
    compiler file path automatically, so the user usually has
    to enter only the former.
  - In the kit settings page, the "C" and "C++" toolchain combo boxes
    have been replaced by a single "C/C++" combo box, relieving the user
    of the responsibility to choose two matching toolchains.

Implementation:
The notion that a Toolchain object corresponds to a single compiler is so
deeply engrained in the code that it cannot realistically be changed in
the short term. We therefore introduce the concept of a "toolchain
bundle" as an additional layer that groups matching C and C++ toolchains
together. This way, most code dealing with toolchains stays unchanged,
and only the presentation layer (i.e. the toolchain and kit settings
pages) needed to be rewritten. Once set up in a bundle, toolchains stay
implicitly linked together so the matching only needs to be done once.

In follow-up patches, we will make use of toolchain bundles in all the
places where kits are auto-created, eliminating the risk of mixing
incompatible toolchains in a kit.

Change-Id: Ie6c5add9963e7c1096268dd77acd624671b2674f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2024-08-05 15:35:48 +00:00
hjk
2a7bf0fdaf Project: Base IDevice on AspectContainer
This is effectively the same approach as taken with ProjectConfiguration.

Having the settings separate leads to quite some boilerplate and in the
end to parallel IDevice and DeviceSettings hierarchies.

The unusual registration of the docker aspects are due to the multiple
inheritance, we need to "dynamic" downcast.

Change-Id: I50864e2009f4e525d635decf1c9beaad5e6a5f1f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-02 13:30:01 +00:00
Christian Kandeler
9d0c144892 ProjectExplorer: Let toolchains be (de)registered in bulk
When some code adds or removes a bunch of toolchains at once, that
should be made explicit and also be reflected by the respective signal
emissions.
Fix some leaks and typos along the way.

Change-Id: I4a1f12a2378316c5faf70e85a88adc467f076caf
Reviewed-by: hjk <hjk@qt.io>
2024-07-19 14:44:47 +00:00
hjk
9e413cb458 Utils: Make Aspect::addToLayout() const
It's conceptionally const, and would be useful to use as such, but
the current implementations often modifie mutable state.

To ease the transition pain, rename the previous non-const version to
addToLayoutImpl() and call it after const_cast'ing.

Change-Id: Ic8ca38e40f5df69c3d11121f96ea37648cf4feb7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-08 05:53:24 +00:00
hjk
4e2d8d0226 Fix more metatype related deprecation warnings
Change-Id: If206b70d263bcdb6d617827fb9cb8fe3214564a1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-11 08:51:23 +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
hjk
f30d369b99 Fix QMetaType::type() related deprecation warnings
Not in sdktool, which still builds with Qt 5.15

Change-Id: I6e6f4331127b821e471e2840e7959cd65e6419e9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-05-23 13:04:22 +00:00
Jarek Kobus
656a30b407 IDevice: Replace QSharedPointer with std::shared_ptr
According to https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews
QSharedPointer impl is poor and it's going to be removed from Qt 7.

Replace QWeakPointer with std::weak_ptr.
Replace QEnableSharedFromThis with std::enable_shared_from_this.
Use std::static_pointer_cast and std::dynamic_pointer_cast
for casts used with QSharedPointer before.

Change-Id: If255a100c790860934f36d52906b93f33c31cfe8
Reviewed-by: hjk <hjk@qt.io>
2024-02-02 16:45:57 +00:00
hjk
d0d0d3b83a Rename a few more ToolChain items to Toolchain
Change-Id: I78e12e6923242fcb72cdde6284185574b8792fc6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-01-23 11:09:32 +00:00
Christian Kandeler
8ef85e481a ProjectExplorer: Re-do the EnvironmentWidget
Editing in the item view was cumbersome and did not generally allow one
variable to refer to another, as there was no defined order on the
assignments.
Therefore, we make the item view read-only and promote the batch editing
widget to be the standard input method. User changes are not sorted
anymore, except in the summary text of the details widget.

Fixes: QTCREATORBUG-28480
Change-Id: I225cf86fff7b001a57d663e1fd267a4645e695c4
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>
2024-01-23 09:54:13 +00:00
Christian Kandeler
f9f43f7492 ProjectExplorer: Let KitAspect pre-select a settings page item
... when the "Manage" button is clicked.
Make use of this in the device settings page.

Fixes: QTCREATORBUG-25077
Change-Id: I1173a72d4c538c839c3e8df278a698b74bd6fca2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-01-19 11:47:26 +00:00
Jarek Kobus
1fe1055277 KitAspects: Avoid using keys()
Instead, iterate directly over the container.

Change-Id: Ie42136f29e5ddab8cd8da76e09616547187a2635
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-01-10 08:54:34 +00:00
Jarek Kobus
b49c40181a GuiUtils: Apply wheel blocker to more widgets
Attach it to configuration and aspect widgets.

Change-Id: Ifd649f6dbf8bbb1ce1cf7251ac46b7cfac9798e3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-05 10:17:35 +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
hjk
c463f944e9 ProjectExplorer: Rename ToolchainManager signals and members
Change-Id: I5195cb785f91dbaafdeeb8bb8c71939a6e3ff9e5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-27 16:45:02 +00:00
hjk
b5937836f4 ProjectExplorer: Rename ToolChainManager to ToolchainManager
Plus the private and some comments.

Change-Id: I95d72d77f25cb1c969a1a6148e7186150a697d1f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-27 16:33:34 +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
fc7c11fb65 ProjectExplorer: Consolidate creation of KitAspect's "Manage..."
Change-Id: I001a21f41bcd5ff0614bdf98893b56137c06546f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-08 09:52:26 +00:00
hjk
fbbb78ee7e ProjectExplorer: Actually instantiate the DeviceTypeKAFactory again
Task-number: QTCREATORBUG-29647
Change-Id: Ic2d29ae8d053f6526d6c5e4f4370153ab5b7d902
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-09-26 12:03:22 +00:00
Marcus Tillmanns
116ad3ed4f ProjectExplorer: Remove IDevice::setDisplayName
also removes IDevice::setDefaultDisplayName

Change-Id: Ie8ac3d95ba1991a20720342de3bf6e97c6414ffa
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-09-11 11:25:34 +00:00
hjk
735e9fc58e ProjectExplorer: Remove ToolChain updating code from 4.3
The current format is apparently stable since May 2017.

Change-Id: I8be705c87578f0e93dbb9494206ccf3e5d8b9e64
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-08-29 14:10:25 +00:00
hjk
b0d78aefff ProjectExplorer: More Store/Key in KitAspect
Change-Id: I6b6e497fac7a3d0f041af727601428bb5c3c441d
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-29 07:47:03 +00:00
hjk
6c2864bd4b ProjectExplorer: And more Key and Store
Change-Id: Id5787890bdb46bfeef8e3f37923e6dc26cb56c31
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-24 11:20:25 +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
Eike Ziller
13fa7703a4 Merge remote-tracking branch 'origin/11.0'
Change-Id: I6c2a1d497aae9bda45c4aae47fb0be6c61c1ec29
2023-08-23 09:30:32 +02:00
hjk
6216c0e924 ProjectExplorer: Don't use object names for KitAspectFactories
Not used. Also the debugger knows the typename and these are
singletons.

Change-Id: I577241876318aa2930bbc36f454846ffa47cb571
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-23 05:38:50 +00:00
hjk
6b82b29e23 ProjectExplorer: Down-prioritize SysRootKitAspect
It's mostly used in connection with the debugger, so put it afterwards.

Change-Id: I6351b4c3db34e1b740c444c04205544ea88b8e8a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-22 09:11:31 +00:00
hjk
60bdb55fe5 ProjectExplorer: Replace some KitManager::onLoaded() connections
... by direct calls. More direct, and less use of QObject-ness of
the KitAspectFactories.

Change-Id: I7487875d95752b681475248ca0e5494d640e064e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-21 06:08:12 +00:00
hjk
e02de2ddde ProjectExplorer: More KitAspect related renamings
Change-Id: I10ad7aacaaf7346f91cadec479f4bba8481b1502
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-08-16 15:09:32 +00:00
hjk
5aa138bb68 ProjectExplorer: Hide some KitAspectFactory implementations
Change-Id: If84dd7aeb72e87d2cb35635689ad1c9c2e09a825
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 13:49:59 +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