Commit Graph

36 Commits

Author SHA1 Message Date
hjk
632993a9b2 Utils: Constify ContainerAspect::forEachAspect
It doesn't modify the container itself.

Change-Id: Ia98da2488398fd7605b2b113b3aa6dfb882ab892
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-01 10:44:26 +00:00
hjk
6f479665f7 Utils: Add manual apply for aspects
The current aspect implementation directly couples ui element
changes with aspect value changes. This is appropriate in situations
like the Build or Run Settings, where configuration changes are
automatically applied.

This change here makes these connections configurable to potentially
re-use aspects in Ok/Apply/Cancel scenarios, as a first step only
for {Bool,Integer,String}Aspect.

The change is source-compatible, but changes the behavior of
BaseAspect::setDefaultValue(): This now _always_ sets also the
value, silently.

Change-Id: I2acd66b42c2251134658d35bb31b5d938149de4f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-26 16:35:58 +00:00
hjk
c8829ff5b3 Utils: Use value/setValue instead of settings also for TriStateAspects
Change-Id: I3d0a58917cd6682e14894e4320d166a1c8de6a9a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-22 12:06:11 +00:00
hjk
fa617b4018 Utils: Fix BaseAspect::fromMap()
The world is not boolean.

Amends a2d6c2b34a.

Change-Id: I4bf901ea6967080964ab1681d2e577fed42a0943
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-22 06:51:12 +00:00
Christian Stenger
49ae9b5b30 Utils: Fix initial values for some aspects
Change-Id: I6ca0360587c2af91d267b59efa9d7bc208b806cd
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 11:41:16 +00:00
hjk
fabd449236 Utils: Consolidate some label related bits of aspects
Change-Id: I55706c87a17f1d011d53ada6055290d4aab2d425
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-19 10:10:33 +00:00
hjk
a2d6c2b34a Utils: Consolidate more aspect functionality
The concepts of 'value', 'defaultValue' and changed signals are present
in a few aspects, with varying implementations. Time to get things
sorted out.

The values are stored now as QVariant in the base, with typed accessors
in the derived classes, keeping the user visible interface the same.

Change-Id: I4d37ef5c7a9795f46ce1bbbabc6a251222b1d54e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 15:55:25 +00:00
Alessandro Portale
97a45f7512 Libs: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I00d9f7c1634bbb62191470d58158e1fd150533c0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:45:05 +00:00
hjk
aec908180d Utils: Stop tracking deleted sub widgets in aspects
Change-Id: I41965c69d55be03d3b2018a2a96eb77c440669b1
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-15 12:31:32 +00:00
hjk
222e8c1286 Utils: Use QPointer for registered aspect subwidgets
Amends 67a3d2e3d1.

Change-Id: I4807fd3409f66b10de5c95d7b07ddfdc7cf9174f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-15 08:37:17 +00:00
hjk
67a3d2e3d1 Utils: Consolidate some aspect API
Handle setting and updating of tool tips, visibility, and read-only
state centrally.

Change-Id: I95205bbb173093ed60f2bf337ac86f3d7ed6d1cd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-10 12:30:39 +00:00
hjk
f48716ec2a Utils: Let BoolAspect announce value changes
Change-Id: Ie8393e577a5ef1cb8626050a9a39bd4b48bda115
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-04 14:06:35 +00:00
Raphaël Cotty
9b8be3b3d5 QbsProjectManager: Add selection of abis for the android target
If the target is android and the qt version has more than one abi
then display a widget to select them in the build configuration.

Change-Id: I9d3ab60a0a1f4aba2e1250c495fa25917b254287
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-18 13:43:35 +00:00
Eike Ziller
45c2634166 Merge remote-tracking branch 'origin/4.14'
Change-Id: I62523c4733e617c46131048f5f62a2ca9be47d80
2021-01-06 08:42:15 +01:00
hjk
34798b3efd ProjectExplorer: Introduce and use a new MultiSelectionAspect
Only provide the minimum functionality to make it usable
for the target selection in Make steps.

Task-number: QTCREATORBUG-25088
Change-Id: I6458a0bd544d2fff596df3240c69e05d7bdea14b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-04 12:00:46 +00:00
hjk
0edebcfa9c Utils: Pimpl BaseAspect
Change-Id: I70a7d49010c24a44dc64d20c5548c249964b78bd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-12-18 14:31:45 +00:00
Eike Ziller
5572bc7220 Merge remote-tracking branch 'origin/4.14'
Change-Id: Ie52e046f8e280e8c39f0cc5e9e710b4f885010a6
2020-12-17 13:10:44 +01:00
hjk
c723db7129 ProjectExplorer: Make ContainerAspect emit when subaspect changed
This fixes updating the -j part of the command when job count overriding
is enabled.

Task-number: QTCREATORBUG-25088
Change-Id: Id5af007fe8de463f761136da0f1109bf902b766f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-12-17 10:17:46 +00:00
Eike Ziller
d8eacfb863 Do not accept rich text in text display aspects
E.g. pasting from a html page should not take over formatting, and in
general we do not want formatting in these edits.

Fixes: QTCREATORBUG-24487
Change-Id: I4f268ed7ee1bd71026e7b446d9a62dcb145a9845
Reviewed-by: hjk <hjk@qt.io>
2020-11-26 15:55:13 +00:00
Eike Ziller
8d67dd57e8 Merge remote-tracking branch 'origin/4.14'
Change-Id: I5e138bb7883c0436fee14ca6af20e99396676af1
2020-11-20 13:00:37 +01:00
Alessandro Portale
7b03e0701d Utils: Fix uneditable TextEditDisplay StringAspect
Change-Id: Ia3f912021b1d4d3cd407d191f8f452149a346c69
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-11-20 11:18:58 +00:00
Eike Ziller
1d2b5db02f Merge remote-tracking branch 'origin/4.14'
Change-Id: I2ae0eb18782224e48cd20d41907f9dfea6ee1771
2020-11-10 13:42:46 +01:00
Christian Kandeler
ad48f2639c ProjectExplorer: Consider build environment
... in "Open Terminal Here" action in the build configuration.

Change-Id: I0b1b15d4f1097cf48eb5a977f2ca5951b2f78377
Reviewed-by: hjk <hjk@qt.io>
2020-11-10 09:01:48 +00:00
Orgad Shaneh
3122a1bfc5 Aspects: Remove some more default values
Change-Id: Iadee8b8f1eeb3ff009a667d45a51f6f5a94329ca
Reviewed-by: hjk <hjk@qt.io>
2020-11-10 08:06:51 +00:00
Orgad Shaneh
836fbed090 Aspects: Remove keys with default values
It was done for some of the types, but not all. This reduces a lot of noise
from the output file.

Change-Id: I64a99e7725ad7cca1f0d90dc296c58c71334ecff
Reviewed-by: hjk <hjk@qt.io>
2020-11-09 13:37:46 +00:00
Orgad Shaneh
51131848ba Aspects: Do not store values with empty keys
Change-Id: I9e8b62915a2278fc3ab35e8b09a330bc0a52e4ae
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-11-09 12:21:13 +00:00
Eike Ziller
3ec8169137 Utils: Don't derive BaseAspects from QList
Use composition instead.
Exporting classes (on Windows) that are derived from QList doesn't seem
to work with Qt6, and it can be argued that composition is to be favored
anyhow.

Task-number: QTCREATORBUG-24098
Change-Id: Icc18fac6680fa09e50b60ed676265e85ee00a89e
Reviewed-by: hjk <hjk@qt.io>
2020-11-06 08:59:15 +00:00
hjk
0f786153f0 Utils: Add docs for some StringAspect functions
Change-Id: I505de81e841db3efb49161cb90b7c60cc22aba8b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-30 15:30:25 +00:00
Christian Kandeler
dd62254e4e QmakeProjectManager: Make "system" execution opt-in
It has too many side effects.
Amends fcd6384f4d.
T_SYSTEM and E_SYSTEM are now treated the same.

Fixes: QTCREATORBUG-24551
Change-Id: Ib6df2762d329f2ddc0dd66190454159d446a9ac9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-16 10:40:45 +00:00
hjk
9fe48b36e4 Utils: Re-use BaseAspect's m_settingsKey for SavedAction
Change-Id: I7ebc8013f15970a56315b3da80969808e505b3bf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-09 08:08:50 +00:00
Eike Ziller
d323eeec52 Merge remote-tracking branch 'origin/master' into 4.14
Change-Id: I4b37b89cc1dd2c53217579ea554af0fb7994fa7e
2020-10-06 10:24:41 +02:00
hjk
2ecb7ceb06 Utils: Do not emit SelectionAspect::changed if nothing changed
Change-Id: Iac2e19d1a093f650ecde6fa9cfdec4714a8e9db4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-06 08:14:38 +00:00
hjk
f4beb6314c Utils: Add some function to StringAspect
- enable/disable the widgets
- enable/disable text edit undo/redo
- possibly validate line edit input

Change-Id: I1933a0f03404de7dcd66475f20d9b7d884ef277e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-05 08:36:38 +00:00
hjk
d97c431a00 Utils: Add some documentation for LayoutBuilder and BaseAspect
... and some related classes and an enum.

This is not a complete documentation for all aspect classes.

Change-Id: I2d98aec012394cc4016e571884b861db7a498b1b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-09-25 09:20:05 +00:00
hjk
2cabd2ceb5 Utils: Consolidate LayoutBuilder interface a bit
- the var args template for addItems was overkill creating a lot of
  instantiations. Use a temporary list instead.
- allow default constructed LayoutItems to be used for an empty cell,
  avoiding the use of a QLabel with empty text
- add an addRow({...}) overload as convenience shortcut for
  .startNewRow().addItems({...}
- rename startNewRow() to finishRow()

Change-Id: I6d49dacbac3d7acf140ca526884ba1ceeeca2e0d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-24 10:32:26 +00:00
hjk
cec468d78a Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils
Classes involved are BaseAspect and some derived classes,
LayoutBuilder and VariableChooser.

This is mostly mechanical, with various include/using changes
to make it compile.

Change-Id: I624a457f3555f102e541c4c71e33a9423af32250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-23 07:44:42 +00:00