Commit Graph

174 Commits

Author SHA1 Message Date
hjk
091b853068 Utils/Core: Make an aspect container layoutable
Most aspect containers end in a widget at some time. Let them declare
how.

The optionspages don't need a layouter anymore when using their
settings' one. There was only one case where there was none, fix
that one (perforce).

Change-Id: Ibd39bcd4af98c3eae1daafa59f6c1d6e7a571989
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-06-22 15:22:01 +00:00
hjk
6b5276220e Utils: Move bool aspect to second column in forms by default
Also let the user opt out if necessary.

Change-Id: Ia7483a3b3de1ce0c119e00594b722e38fa2d0bb2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-22 07:53:58 +00:00
hjk
f19481e6c7 Utils: Make FancyLineEdit placeholder validation optional
Validation makes only sense if the placeholder is similar to
the actual contents, like a file path, not for explanatory text.

Amends 3dcdbe9.

Change-Id: I81ff7a3cf72f28c0fe49824b574b0997ada2d09b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-12 13:17:17 +00:00
hjk
35c60cd7b4 Incredibuild: Auto-register aspects in build steps
Change-Id: Ic36ac230c92df4b18649aa19a57f7a424a593db3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-09 10:15:30 +00:00
hjk
49e17591ea ProjectExplorer: Use aspects as direct members in MakeStep
Less indirection.

Change-Id: Ie0086f7f2365512694fb3de77d3efc838e6e95ed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-07 14:17:40 +00:00
hjk
f5d02f4bcb Utils: Fix compilation with recent Qt dev
After an update of Qt dev the following code in Creator fails to compile with

/data/dev/creator-out/src/libs/utils/aspects.cpp: In member function ‘void Utils::IntegersAspect::setValue(const QList<int>&)
/data/dev/creator-out/src/libs/utils/aspects.cpp:2323:35: error: no matching function for call to ‘transform(const QList<int>&, <unresolved overloaded function type>)’
 2323 |     BaseAspect::setValue(transform(value, &QVariant::fromValue<int>));

Work around by using a lambda.

Change-Id: Id5a844e7e5fe1846c4904dbad21472743439c4da
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-06 07:45:48 +00:00
hjk
5bacd9328e Utils: Add a overload taking a AspecContainer for TextDisplay
Change-Id: If6cc933e852b80c4ec6abcc2477db8852392ca69
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-06-02 11:58:54 +00:00
hjk
64c48af15b ProjectManager: Auto-register build settings aspects
Add the necessary contructor to TriStateAspect, too.

Change-Id: Ieb0f19cdf95f7492380d7c4e5663f455e4da3452
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-01 11:36:43 +00:00
hjk
9375979698 Utils: Make PathChooser remote support configurable in aspects
... and switch is _on_ by default.

Change-Id: I82e66da477dae1ee955b81babc6230b67e530d45
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-06-01 08:31:46 +00:00
Leena Miettinen
08b5f64c1a Doc: Mark destructors as \internal instead of \reimp in Aspects docs
Document BoolAspect::value().

Change-Id: Ia7f359e9302d371e3ea79fc3fce04e3c3c9a22a0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-26 13:58:10 +00:00
hjk
320064f431 Utils: Allow more finegrained subaspect ownership in AspectContainer
Currently this luckily conincides with the register/addAspect schism
but that's not necessarily true in the future.

Change-Id: I05a59d74182dbdf81193ebd790d6f9bab2d30439
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-25 11:41:50 +00:00
hjk
75710fa369 Utils: Remove LabelPlacement::AtCheckBoxWithoutDummyLabel
This is identical in remaining functionality to AtCheckBox after
the recent layout builder changes (or rather, can be adjusted on
the layouting side by having appropriate empty cells)

Task-number: QTCREATORBUG-29167
Change-Id: Ic357de6fb756acb5926afe1fd361ee4b18b17afd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-24 09:53:05 +00:00
hjk
0234ab6896 Utils: More aspects with new scheme
Task-number: QTCREATORBUG-29167
Change-Id: I76977d4d740556d28423ce9f632ee47e81822ee6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-24 09:49:56 +00:00
hjk
962d9d55d0 Utils: Also allow FilePathAspects to auto-register
Task-number: QTCREATORBUG-29167
Change-Id: Iba301764072cc1ca3d3a335a8106ab121733b387
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-23 14:55:36 +00:00
Leena Miettinen
a0f64b133d Doc: Fix qdoc warnings in aspects docs
Add \a commands and mark things \internal if qdoc cannot find them.

Change-Id: If7a9303e5053af4eb58a08caafd53ffa6ee604b5
Reviewed-by: hjk <hjk@qt.io>
2023-05-23 12:51:01 +00:00
Leena Miettinen
e45609194d Doc: Remove period from the end of \sa
The HTML generator adds it automatically and qdoc warns about it.

Change-Id: I3917d7d23b16446e28ce7bfeb8f9195f21efd7fc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-23 09:31:53 +00:00
Eike Ziller
3dc5bbfa1f Merge remote-tracking branch 'origin/11.0'
Change-Id: Ic7bd1fb91f46c5f8fef47b2c442382186aeb7ad3
2023-05-23 10:17:31 +02:00
hjk
a4c962aa33 Utils: Introduce aspect ctors referring to an "wrapping" AspectContainer
This removes the need to manual 'registerAspect' calls in most cases.

Whether the containers owns the registered aspects or just references
them is still determined by AspectContainer::setOwnsSubAspects()

Change-Id: Iadd17c919287f625bf5eb4964de4149d4da5a0f9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-23 06:08:35 +00:00
Leena Miettinen
8c288bf05f Doc: Add "\inmodule QtCreator" to \class and \namespace docs
To get rid of QDoc warnings.

Change-Id: Idd39b7ae4327798c376f424c94d6617bcaee2258
Reviewed-by: hjk <hjk@qt.io>
2023-05-22 12:48:35 +00:00
Christian Stenger
c5818cfe6d Utils: Fix pathchooser handling for aspects
..especially when entering a path manually. Fixes some
soft asserts regarding the call guard and re-allows to
type a backslash directly to separate path from sub-path
instead of using wild workarounds like adding a dummy
character and adding the backslash before this.

Change-Id: I8cc8aaccf414d0fd9acc03d7c69e10ddd88dbfd9
Reviewed-by: hjk <hjk@qt.io>
2023-05-22 11:18:31 +00:00
hjk
d0881f5542 Utils: Remove a unused aspect ctor parameters
Change-Id: I6e3c6ce7b04a7817f35da10f1975ae2fec62b9e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-22 07:16:23 +00:00
hjk
d740a355bb Utils: Rework CheckableMessageBox
Remove function overloads, thes are hard to read, to use and to extend.
I'd even argue this should be a plain default ctor and a few setters +
exec(), pretty much like Process::start() nowadays.

Move "decider" magic into a structure that can be filled ad-hoc outside
checkablemessagebox.cpp paving the ground for:

...removing  aspect dependency from CheckableMessageBox, Instead, add a
convenience function to BoolAspect.  Arguably, the latter is not needed
and could be done on the user side.

Use pointers instead of mutable references for in-out parameter.
Makes the "specialness" visible on the user side.

Pass ICore::settings() centrally as done elsewhere to reduce line noise
on the user side.

Change-Id: Ibb366353d1ea35401723fd05ce05672617a0a8fd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-22 06:40:13 +00:00
hjk
40d7fcc1d4 Utils: Remove check against 'autoapply' for some volatile aspect value
This was based on the wrong assumption that on !autoapply aspects
(i.e.  aspects in settings pages the non-applied value would never be
needed by user code. This is, however, not the case when e.g.
temporary checkbox states or values in comboboxes are used to
enable/disable parts of the ui while interacting with the page.

Change-Id: I4fe6a0df8137083a0a0faecc3ba20792caa5a747
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-19 14:32:40 +00:00
hjk
a21b96f4b6 Utils: Allow a BoolAspect to adopt an external button
This will be used by the apply machinery and allows more
complex setups than the automatically generated internal
CheckBox button.

Change-Id: I237a9283253f11bcb76e0366a0b6c5a0346fdfd8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-17 05:51:30 +00:00
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