Commit Graph

901 Commits

Author SHA1 Message Date
hjk
e88f65866c ProjectExplorer: Paddle back on IDevice aspect exposure
Make the aspects private, but provide accessors to value and
defaultValue as needed. This allows setters to be kept protected
when wanted.

Change-Id: I26f93f62d4ac2e7346f95543c38d8ac9156348c2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-06 11:13:40 +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
hjk
b6eff1b9cf ProjectExplorer: Change IDevice::toMap signature
From  Store toMap()  to  toMap(Store).

More symmetric code on the user side and better in line with
ProjectConfiguration/AspectContainer at the price of a few
more lines in the base.

Change-Id: I6069c96c250c1846e870879bcb52c58fdd806478
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-01 14:54:43 +00:00
Alessandro Portale
a0e37a76fa Plugins: Add URLs to manual page to plugin metadata
Fixes: QTCREATORBUG-31199
Change-Id: Ideadc75499f32a8f1d1c95cd38dc4669a3d422c3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-29 07:27:29 +00:00
hjk
f49523029a Remove #include <utils/fileutils.h> from most header files
It has some platform specific warts, filepath.h is somewhat
cheaper and less ugly overall.

Partially clean up surroundings

Change-Id: Ida1fd470ec020f69c446109427f92a08e879789f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-07-26 10:41:16 +00:00
Eike Ziller
959f5fa3a2 iOS: Simplify starting simulator
We do not need different code paths for Xcode < 9 nowadays.
Just tell simctl too boot the requested device and make sure the
Simulator app is running.

This also fixes an issue if for some reason a different device is already
booted without the Simulator app running, e.g.

1. make sure Simulator is not running
2. boot a device from the command line with
   `xcrun simctl boot <deviceID>` (get the device ID from the Devices &
   Simulators window in Xcode)
3. start Qt Creator and run an application on a *different* simulator
   device

Without this patch Simulator app opens with the device from (2) and
deployment of the application fails for the different device.
With this patch the device for (3) is booted and the application
deployed and run.

Change-Id: Ifce8c470f2d4d646295ca4e47fbd92308f87adf8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-24 12:04:47 +00:00
Eike Ziller
5cd35e33b3 iOS: Unify error output handling for all simctl commands
If simctl fails, always include its stderr output in the error, if any.

Change-Id: I7a5643ac81befc9d0595e9c3bd4fa009057ff85b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-24 12:04:36 +00:00
Eike Ziller
4fb63e4c9d iOS: Remove unused variable
It was set, but nobody was actually using it.

Change-Id: I99c6fcd4605591d65e5f3fb3f489a3de0c61fb24
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-24 07:45:24 +00:00
Eike Ziller
84cc7208de iOS: Improve error message when installation on Simulator fails
In case of error, post the output of the simctl command in compile
output and issues pane.

Fixes: QTCREATORBUG-25833
Change-Id: I62a0f7b10b5188a7c8b4e1db543b66d0661d4e6a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-19 14:05:12 +00:00
Eike Ziller
18937fd44b Merge remote-tracking branch 'origin/14.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	src/plugins/qmljseditor/qmljseditordocument.cpp

Change-Id: Ibef70b4c0eba5ccd5da7b05ca2bd3a9e8ee1cc0c
2024-07-17 11:43:34 +02:00
Jarek Kobus
ad7de40a9d IosToolTaskAdapter: Don't leak the IosToolHandler on destruction
The TaskAdapter may be destructed at any point in time,
even when the task is still running (i.e. when the task tree
was canceled). Make sure the internal IosToolHandler gets
deleted in this case.

Amends 150441bf88

Change-Id: I1ae4d324390c38d4faf9ec32f83c66295ed18532
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-12 07:53:49 +00:00
Jarek Kobus
5aea1a817a TaskTree: Make most of TaskAdapter subclasses final
Change-Id: Ie6652c6f327b5a47b3a4cab58e64fbea0cb71276
Reviewed-by: hjk <hjk@qt.io>
2024-07-10 13:39:54 +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
Eike Ziller
38e005692e Plugin meta data: Add full stop to descriptions
Where they were missing. The text is shown as a paragraph in the
extension manager.

Change-Id: I6e15c89fe4023b222e9c476f4312e13fcb0905c0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-28 06:46:52 +00:00
Jarek Kobus
15e510abcf TaskTree: Make use of the trivial DoneResult handlers
Change-Id: I71915fc50f073cc90b0fb2562bb82e9c4a73ccd1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-19 08:32:37 +00:00
Jarek Kobus
81ed276828 IosToolHandler: Don't call stop() from the other thread
Task-number: QTCREATORBUG-30633
Change-Id: I0ddb354dbd3be685919b98589a5f0d534bd30dbe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-14 12:39:47 +00:00
Eike Ziller
caa5c3947f iOS: Fix slow debugging with recent Xcode and iOS < 17
When starting the debugger, we need to pass it the location of the
downloaded device symbols, or otherwise debugger startup is very slow.

Xcode changes the location where it saves this information once in a
while, and it must have again. The location with Xcode 15.2 at least is
in the style "iPhone8,1 15.7.3 (19H307)", i.e. it starts with the
"product type" now.

Retrieve the product type of the device and add another candidate
directory for device symbols.

Fixes: QTCREATORBUG-31044
Change-Id: I1a65305fc84c1af8cd48c4ebb249167e1dbe6ae1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-13 06:09:47 +00:00
Leena Miettinen
6cd7aed8eb Add long descriptions to some plugins
Edited the short descriptions to answer the question
"What can I do with this extension" to help users decide
whether they need it.

In long descriptions, tell users what else they need to
be able to use the plugin.

Change-Id: Iefce7505b61fc77cf38cc915f1f7dbd25c9cb570
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-05-31 06:42:53 +00:00
Alessandro Portale
7bc65cf9f3 PluginSpecs: Change URLs from http:// to https://
Avoid the redirect that is inevitable nowerdays.

Also, change necessitas.kde.org to www.qt.io, since the orgininal page
is offline.

Change-Id: Ib1823f0df97d2df87822fd2bb7552e2f2c7e971e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2024-05-28 20:13:29 +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
Jarek Kobus
982ad24243 CommandLine: Reuse new c'tor
Change-Id: Id154881b4f5d8c488e5c1f5e0f843d36bf838759
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-22 09:13:41 +00:00
Eike Ziller
eb45240649 Remove PluginManager::futureSynchronizer()
Use the global synchronizer from Utils::futureSynchronizer() directly

Change-Id: Ic8843bc1ff7951c041529a258f36117f08ec4b35
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-05-21 13:02:46 +00:00
Eike Ziller
0fe7350368 Merge remote-tracking branch 'origin/13.0'
Change-Id: I0892d8e54930bb5a65dc51117b8ca7d70ce300a3
2024-04-17 13:29:02 +02:00
Eike Ziller
cf7933a980 iOS Simulator: Fix crash when starting app while another is running
Qt Creator would crash when starting an app in the Simulator while
another app is running, and the old app is not killed by the deployment
before run. This could happen in two cases:

1. Running an app in one simulator device and starting that or another
   app on a different simulator device
2. Running an app in the simulator and starting that or another app on
   the same device without deployment

In the first case, it actually doesn't make sense to stop the running
app, the Simulator can run multiple devices simultaneously (this might
have been different in the past).

In the second case, the new IosRunner initiated a stop of the old
RunConfig, and while that was in Stopping state, the app output window
tried to re-use the old tab and deleted the old RunConfig. This lead to
an assert in the RunConfigPrivate destructor, which only expects to be
deleted when in Initialized or Stopped state, and eventually to the
crash. The app output window should not reuse tabs that are not
"Stopped".

Fixes: QTCREATORBUG-30666
Change-Id: If46904dd487301e465e89ce7946be375ab4bdee8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-04-16 09:58:35 +00:00
Christian Stenger
fc3047fb1b Ios: Fix qbs build
Amends e8d6e4fc34.

Change-Id: I67185c856a28071c2428ac593f54d31f99c3411d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-04-09 13:53:07 +00:00
Eike Ziller
e8d6e4fc34 iOS: Remove simulator management from settings page
Simulators can be managed via Xcode, which must be installed anyway. Re-
implementing this functionality is not useful, error-prone, and a
maintenance burden. Point users to the corresponding Xcode documentation
instead.

Add a button for updating the list of simulators in the run configuration
settings (which didn't update when simulators were changed in Xcode).

Change-Id: I5a861f21851bb866d45a703f46bb20ed5df960e8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-04-09 07:36:26 +00:00
Eike Ziller
1b97fdc100 Merge remote-tracking branch 'origin/13.0'
Conflicts:
	src/plugins/debugger/gdb/gdbsettings.cpp
	src/plugins/perfprofiler/perfprofilerruncontrol.cpp

Change-Id: I0d5b914f9d9b5499920a5db484ef77af6ae748d5
2024-03-12 09:27:39 +01:00
Jarek Kobus
2cf2843b38 CreateSimulatorDialog: Skip explicit call to waitForFinished()
This is done by the FutureSynchronizer d'tor, so no need to call
it explicitly. Move the FutureSynchronizer as the last field of
CreateSimulatorDialog so that its d'tor is executed first.

Change-Id: I861e4c6498b63909fe52965ca16343ef82d20b42
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-03-07 08:20:26 +00:00
Eike Ziller
e31a06a0f4 Android/ProjectExplorer: Fix crash when removing multiple Android Qts
That were configured for a project.

The crash is triggered by a messy combination of the Android automatic
kit creation, project window update, and automatic creation of Qt
versions and kits by the automatic project importers, including a mess
of the listener pattern without any atomicity.

- the user removes the Qt versions
- the Android plugin updates the automatic kits and individually reports
  the removed kits (*)
- that triggers an update of the project window and an update of the
  target setup page (even if that is not shown, but that's yet another
  issue)
- that triggers the project importers, which add Qt versions, which in
  turn triggers another update of automatic kits in the Android plugin -
  while that is still in the reporting loop at (*)
- that leads to the crash, because the state at this point of time is a
  mess

This minimal fix of the specific crash makes the kit update reporting in
the Android plugin at (*) "more atomic", and the same for similar code
in the iOS plugin.

Fixes: QTCREATORBUG-30347
Change-Id: I2bea6fb735abcaa34469fc43f44aa37313f70429
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-03-06 10:46:44 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-02-28 08:09:05 +00:00
Eike Ziller
a8414effd8 Merge remote-tracking branch 'origin/13.0'
Change-Id: If752e3383b35873b696e8beca27d8838a4096c8a
2024-02-27 09:04:51 +01:00
Eike Ziller
76cd84b7cd iOS: Fix some missing full stops
Change-Id: Ie6c1b9dafc3e3fe349adcbe6011244136002cc01
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-02-26 09:09:47 +00:00
hjk
7c5a0e6bb2 Rename RunControl::aspect to RunControl::aspectData
It's the "persisted" form of the content of the original aspect's data,
calling it 'aspect' already confused me a few times.

Change-Id: I88a6f76f0ca39d3d36dde9b84287032ceecf7033
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-02-16 10:21:15 +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
Marcus Tillmanns
78d42d2d54 IOS: Don't save default values needlessly
Change-Id: I127ee409f6bb0011704fcb08ef720a71fd084a16
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-02-05 15:28:36 +00:00
Eike Ziller
220237d029 Merge remote-tracking branch 'origin/12.0' into 13.0
Conflicts:
	src/plugins/ios/iosdevice.cpp
	src/plugins/texteditor/bookmarkmanager.cpp

Change-Id: I92931f29c3992054dac84dbfa2dfc0c1bfb31430
2024-02-05 10:52:42 +01:00
hjk
435b35ccfe Ios: Use setup functions for a few factories
Change-Id: Ide05c2ca859454c1745e5c243af6a3d05131194c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-02-05 07:06:55 +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
Eike Ziller
d93e95c942 iOS: Fix missing include
Breaks the build with Qt 6.7

Change-Id: Ie3e940a26cbd982f7781cfe478b59fc44785efe2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-02 12:04:19 +00:00
Eike Ziller
acf7d30cbd iOS 17: Print messages for starting and stopping
In the application output, like we do when running elsewhere.

Change-Id: I842701162df20403e2b9757bc78bdd61176d581d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-02 08:16:55 +00:00
Eike Ziller
a7a06d6f79 iOS: Move launch result from devicectl to a function
And add a test to document what we expect from devicectl.

Change-Id: I1a7f03c50393b99eddb2bfd34b5857e15b28d0a7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-02-02 08:13:27 +00:00
Eike Ziller
e32d3da321 iOS: Move process id gathering from devicectl to a function
And add a test to document what we expect from devicectl.

Change-Id: Ic69af99a472976a6c06801a646af59f8139d5624
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-02 08:13:15 +00:00
Eike Ziller
2898e09bb4 iOS: Move app URL gathering from devicectl to a function
And add a test to document what we expect from devicectl.

Change-Id: I2f5312ebadef60239b77308acb7114f1d55143b4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-30 10:06:29 +00:00
Eike Ziller
15baf18911 iOS: Move info parsing from devicectl to a function
And add a test to document what we expect from devicectl.

Change-Id: I395171bb5316c21b461a01dce5c9ec87d81fb0c4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-30 08:38:03 +00:00
Eike Ziller
a9a5972a9f iOS: Add some autotests for devicectl error parsing
Change-Id: I641f0c86b30a11ca6321db88afbf2969b4863972
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-30 07:56:31 +00:00
Eike Ziller
85f7917911 Ios: Only ever show a single dialog for developer mode
It can happen that this is triggered twice for the same device, or for
other devices when the dialog is still open. This looks funny and is not
necessary, so avoid it.

Task-number: QTBUG-121557
Change-Id: I0329104b3825b68b565ca1f8e00d785952c9d767
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-30 07:56:05 +00:00
Eike Ziller
479f1f34ce iOS: Disable anything but running for iOS 17+ devices
We currently cannot support anything than running for devices with iOS
17 and later.

Make it possible for RunConfigurations to state that they are disabled
depending on run mode.

Change-Id: I13df4dd482f6381cda15168c38ede00d95e1d692
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-01-29 12:13:51 +00:00
hjk
6218520b63 iOS: Move build configuration factory definitions to .cpp
Change-Id: Ia4a52e61488900fca013a50185ae534faa8816eb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-26 12:58:53 +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