Commit Graph

150 Commits

Author SHA1 Message Date
hjk
671621d79b Utils: Introduce a FilePathAspect
A shallow wrapper around a StringAspect with a suitable operator().

Change-Id: I0a5e121565d03573faa5c3f4085d72db2b9c3774
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-16 12:59:44 +00:00
hjk
ab8f3d78ae Utils: Use QAbstractButton instead of QCheckBox in BoolAspect
Opens the path to use e.g. QRadioButton.

Change-Id: Idb1591c0a1486181b8aeb51edb93bc4bfecef834
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-12 16:17:49 +00:00
hjk
4c1a161abd Utils: Fix some IntegerAspect value display issue
... when a display scale factor was set.

Change-Id: I764db99e444f9cc70871c3dbec101d0b65542c4a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-12 14:54:01 +00:00
hjk
5cf5b1ae3f Utils: Add an AspectContainer::changed() signal
In contrast to applied() only emitted if anything was dirty before.

Ideally, applied() would not be needed, but I am not sure about
downstream uses.

Change-Id: Ie0c293b8730c503fc4409884a33207ee9ca5f129
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-12 14:29:11 +00:00
Christian Stenger
1a86c7bed4 Utils: Remove empty item after option
Triggers a soft assert.

Change-Id: I9ad863ceb7e1f377e4f9fbae62cca1d0932a76d6
Reviewed-by: hjk <hjk@qt.io>
2023-05-12 06:22:17 +00:00
hjk
268da290b2 Utils: Guard SelectionAspect value access against out-of-bounds access
Change-Id: I6ca414015cb55f06b7264949487fafc7eb57efd3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-11 15:08:17 +00:00
hjk
7bd3ee8123 Utils: Add more FilePathChooser config options to StringAspect
Will be used in the Beautifier plugin.

Change-Id: I6e70f757a25afcdf1d3e3742357d71503f210b2a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-11 12:47:59 +00:00
Christian Stenger
2d58d1b280 Utils: Fix groupChecker functionality for aspects
Change-Id: I1a44384cfebe8e23d8778ccb97f5846bfcbf0b9f
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 12:20:20 +00:00
Marcus Tillmanns
84b2862058 Utils: Improve CheckBox layouting
This is not correct either, but the vast majority of Checkboxes
is not added to Forms, so the !form case is a better fallback.

Change-Id: I1375b3e23138fb6d881b2331ecf1d0f3a4f5431b
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 08:52:20 +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
70b02d23e1 LayoutBuilder: Rework
Everying is a LayoutItem now, and everything is split into
a proper setup and execution phase.

Execution happens only via LayoutBuilder (directly or via
convenience wrappers in LayoutItem).

No direct access to the widget in creation, funnel out is
via the new bindTo() facility.

Change-Id: I7eb38fd736ae57a68f9a72a6add5c767da82b49f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:02 +00:00
hjk
8f345bbc35 Layouting: Drop compile dependency on BoolAspect
Change-Id: I4068048f470db126a2583d6b1b90245205cfd601
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-02 06:09:04 +00:00
hjk
8cf500c5bc Utils: Make Layouting a top level namespace
The whole machinery is now almost only layoutbuilder.{h,cpp},
mostly independent of the rest of Utils. Idea is to finish the
separation to make it stand-alone usable also outside creator.

Change-Id: I958aa667d17ae26b21209f22412309c5307a579c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-25 13:31:25 +00:00
hjk
72d72251d8 Utils: Start decoupling LayoutBuilder from Aspects
Makes it easier reusable elsewhere.

Change-Id: I86ff9f40229a33690f854f5fda692bc06d6976ef
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 10:55:29 +00:00
hjk
2766b4004b Utils: Continue Environment/EnvironmentChange consolidation
Make Environment a stack of changes that gets "expanded" to
a full environment before things are actively accessed.

Later this expansion should be done lazily if possible.

Task-number: QTCREATORBUG-28357
Change-Id: If1c7bfdb9f58b81e71c51ed87ee75d6964a47019
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-24 07:45:35 +00:00
Marcus Tillmanns
682ef157d8 Terminal: Add Terminal plugin
Adds a new Terminal plugin that provides a Terminal pane inside
Qt Creator.

Fixes: QTCREATORBUG-8511
Change-Id: I7eacb3efa2463d7df9f383ae3fc33254fb9019a9
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-02-24 10:19:33 +00:00
hjk
40b295cbab Utils: Move some translated strings from .h to .cpp
Default values shouldn't have complex initializations anyway,
these end up in each instance on user side.

Change-Id: I81394c3df353b34b19454130f58bd646318feccd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-08 19:36:07 +00:00
Alessandro Portale
48affa1889 Translations: Remove header includes of *tr.h in .h files
The wrong Tr::tr could be executed by code indirectly including a *tr.h
file from another module.
To Translate in a header file, use QCoreApplication::tr().

Change-Id: I30e67245991d2c2f0eeb01ab356555bdb9841af0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-08 11:08:48 +00:00
Alessandro Portale
4d6827dde9 Utils: Tr::tr
Change-Id: Ic03e20993f05fb5b49a12c891d86afb2c8e18e08
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-02-01 13:48:22 +00:00
hjk
5f359a1dff Utils: Start Environment/EnvironmentChange consolidation
The plan is now to keep 'Environment' as the concept name, but
have what is currently 'EnvironmentChange' as implementation,
as keeping a full env vs env change(set) distiction gets messy.

First step is to cut the direct dependency of EnvironmentChange
from a (current) Environment that causes circularity when moving
the implementation.

Change-Id: Id8b512b311071611b750b27af59549ce7c2ce8e6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-27 11:24:36 +00:00
hjk
642c593481 Utils: Flatten LayoutBuilder related hierarchies
Originally the idea was to only expose LayoutBuilder, but we
are getting more and more related items. Be consequent now,
and have everything in Utils::Layouting, but not in nested classes.

Change-Id: Ic0f98595882e5c60a25c30ec52df4a0ea79bc0ca
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-20 12:44:30 +00:00
Christian Stenger
daf0e062e1 Various: Adapt to change in FilePath
Change-Id: I9218b7378ffb8662338351a551f5809914f18a62
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-01-17 14:28:34 +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
Cristian Adam
5e9f8b30d4 Utils: Add defaultValue getter for Aspects
Does the variant conversion based on the aspect type.

Change-Id: I2127a5a4202c3a60b946492b90a78beabaa11aed
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-05 10:02:02 +00:00
hjk
36c025ba2d Utils: Change Aspect readOnly default to false
Change-Id: Ib1f593b55f9e187e57ac7f57173c5b16fdce4b63
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-12 08:07:03 +00:00
Jarek Kobus
9d5d350f8f StringAspect: Fix setting readOnly
Change-Id: Ie8060052c04aec23dfb2b68d127c323dc017844e
Reviewed-by: hjk <hjk@qt.io>
2022-12-06 10:53:03 +00:00
Jarek Kobus
7bc86a8b8d Utils: Fix clazy "Mixing iterators with const_iterators" warnings
Change-Id: Iab29d57459713e107d7e74908df347955b9f50a0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-11-30 07:14:09 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
1567d24980 Utils: Replace PathChooser::{fileP,p}athChanged signals
... by a new PathChooser::textChanged signal.

They were both emitted in reaction to the underlying line edit's
textChanged() signal.

Use 'textChanged()' as name to mimic/match the Qt side. This also
makes it more clear on the user code side, when this happens.

Some textChanged() consumers should probably use editingFinished()
instead, but that's left for later changes.

Change-Id: Ib07347f616cbf1c5d09bc2f8671ca860d185d1f9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-06 05:01:51 +00:00
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
dc839df59b Utils: Introduce a Layouting::empty item
A bit more explicit than the current mix of Space() and asserting {}.

Change-Id: Ia296b1d23294dfccd1e33827e136b821a4d2c6fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-26 09:08:18 +00:00
Jarek Kobus
74ea4dc07d Drop Qt5: Utils: Get rid of QOverload
Change-Id: I864bfb18668fd325badd34003adf494c7924f86b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-20 10:30:25 +00:00
Christian Stenger
ae1e006426 Utils: Allow programmatically change of IntegerAspect
Using setValue() on an IntegerAspect only had a visual effect
if it happened before adding it to a layout.
If the aspect had been added already the value silently got
changed (internally) but this was never reflected on the
respective SpinBox.

Change-Id: I60297d9d38835842b3b02a36787c0a2001477427
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-07-08 07:00:08 +00:00
Marcus Tillmanns
6003fe9b36 docker: Fix StringAspect default value handling
The StringAspect needs to return a possible default value if
no value was set by the user. Otherwise it would write an
empty string when ::apply was called.

Also a small improvement for docker error logging is added

Change-Id: I85f80253894d2c3e726da714616e5275039febcc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-07-07 13:09:02 +00:00
Christian Stenger
7f30c3b137 Utils: Allow placeholder text for path chooser aspect
Change-Id: Ic2b27c1b239031e739322a6afbc6b30f293abda6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-07-05 11:09:14 +00:00
Eike Ziller
1b89bcbf5e Fix application of value to StringAspect/LineEditDisplay
It was not applying the value when changing the text via a completer.
That lead to confusing result where values were cut off (and also saved
in the settings as such) at seemingly arbitrary cases.
Ensure that the text from the line edit ends up in the aspect by also
applying it on editingFinished().

One example where that exposed, was the executable aspect in the
RemoteLinuxCustomRunConfiguration.

Change-Id: I65c434fd675eeead76a73f680c126fd204d7c996
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-06-23 08:45:24 +00:00
hjk
8066ce8a6f Remove a the necessity of a few weak vtables
For background, see QTBUG-45582.

Change-Id: I6c4758ce62149437c26971056b465d5dbd2b13b0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-22 11:41:36 +00:00
Eike Ziller
9ab0510eaf Aspects: Update of combo box when changing TriState value
Call SelectionAspect::setValue instead of skipping it and calling
BaseAspect::setValue directly. That takes care of updating the combo box
state.

Amends c8829ff5b3

Change-Id: I55e90459c2b54da09883f746b61b19d46acfdf92
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-06-08 07:52:22 +00:00
Jarek Kobus
4b9545fe7f Utils: Drop unused headers [A-H]
Round 2 - focus on sources.
For classes with initial in range [A-H].
Try to keep the same separators between different kind of headers.

Change-Id: I838a8324ddd5b4d8d5a51b8f30605f783c663813
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 07:47:09 +00:00
hjk
8dacb123e0 Utils: Pass MacroExpander to ArgumentsAspect constructor
In the past we wanted to keep the aspect constructor simple but
it turned out that exceptions were needed and accumulating, so those
are likely here to stay.

By passing also the MacroExpander to the ArgumentsAspect constructor
allows other single-purpose warts like the ProjectConfiguration::doPostInit()
machinery can be removed.

Change-Id: I148b0ca1ab0740270eecd0d3134620de65a86d4f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-20 07:06:10 +00:00
Jarek Kobus
0a8dbaf153 Utils lib: Remove unneeded includes from cpp files
It's a result of a team work consisting of yellow triangle and me.

Change-Id: I8b4812766da70e0785ae71bf0cb71357379e2514
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-19 12:37:20 +00:00
Jarek Kobus
92d7e4601d QtcProcess: Forward declare Environment in QtcProcess header
Change-Id: If85a8a07b144c94cb6e45f66dcb06573ef07c777
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-05-09 07:42:40 +00:00
David Schulz
7000ab04fb Utils: add default file path to string aspect
Change-Id: Ia3df289b0b2dc59f6e7098332c21a335dce207f1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-05 13:35:43 +00:00
Eike Ziller
0d586e96ec Merge remote-tracking branch 'origin/7.0'
Change-Id: Ica0f410a8248722cef95a9cbf3929a2d29bf91c0
2022-04-27 11:19:31 +02:00
Cristian Adam
8c050eaad9 CMake: Set the build directory change after Browse
As an user I expect when I select Browse for the build directory
that after the directory has been chosen it will be taken into
consideration.

Amends 1d600101ee

Fixes: QTCREATORBUG-27407
Change-Id: I331b6095c176f57ca8e4c73c0b378a11ce3d6dbc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-04-26 13:24:48 +00:00
hjk
5da8695dca ProjectExplorer: Pass envAspect directly to WorkingDirectory constructor
This trades a now necessary order of setup for the now removed
"acquaintSiblings" facility.

Change-Id: I85058578b792e210f24573e2ab4e3a40a8813a11
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-22 11:53:59 +00:00
hjk
a26f0ba808 Debugger: Avoid one use of RunControl::runConfiguration()
Change-Id: Iaf9fb0cee4544121a4df433c3726d98ae0175ff2
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-14 09:25:46 +00:00
hjk
530b9ae85a ProjectExplorer: Copy more RunConfiguration data to RunControl
The aspects are now responsible for defining what data needs
to be copied and also to provide a suitable interface (kind
of source-compatible to direct use) for access.

The important change here is that RunControl::aspect(...) doesn't
need to access RunControl::runConfiguration() in fully aspectified
RunConfigurations anymore. In not-fully aspectified the runConfig
access is moved to the user code to make the problem visible there.
Long term, aspectification should be finished.

As an additional benefit, the resolving of macros etc can
now be done at the correct time.

Change-Id: I690d9f8f696ce9b4efd42082ba3f81b514efcb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-04-12 08:43:09 +00:00
Cristian Adam
68cb80f276 CMakePM: Add options link to the CMake offline/online documentation
This way a user can quickly find out which options can be used.

Change-Id: I6347759689a4a1431a82ff9414da0c79e357eb45
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-04 13:12:15 +00:00