Commit Graph

56 Commits

Author SHA1 Message Date
hjk
035a6ff031 Utils: Avoid intermediate widgets when using LayoutBuilder
In most cases, the layout constructed in the builder was set
on a widget which in turn was put into a vbox in the actual
widget. This is not necessary, but needs some re-ordering.

Also make sure that using not-yet-parented widgets during
layout construction does not cause visible artifacts.

Change-Id: I75727a571da093d3131ea6fba467c2c646cdb6f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-16 11:37:44 +00:00
hjk
687d6a76ec Utils: Add a AspectContainer::isDirty convenience function
Change-Id: I8503c715742bce8f59da9b0e6c7e7a85c5fc397b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-16 07:18:38 +00:00
hjk
d5dec08893 Utils: Pass settings key to BaseAspect::saveToMap
Makes the code on the user side somewhat more symmetric and is a
bit more flexible, even if that's not used right now.

Change-Id: I29a5182463ead0e4a39fcb51ecf4fdd5adf2a203
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-12 11:30:22 +00:00
hjk
4cebde86da Utils: Remove two unused AspectContainer functions
Change-Id: I786c80a84ee40cb6ea6711c13c208bd00ee6ad82
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-12 09:14:30 +00:00
hjk
cb55af8e55 Utils: Replace BaseAspect::setVisibleDynamic by setVisible
This was a workaround from a time where BaseAspect didn't know about
subwidgets created by derived aspects. That's not the case anymore.
Subwidgets registered with registerSubWidget() get their visibility
adjusted by BaseAspect::setVisibility() nowadays.

Subwidgets not registered with registerSubWidget() should not exist.

Change-Id: I8cdf72e5ea1f93c519f606913e084c78afecb56f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-09 11:30:10 +00:00
Eike Ziller
08f8dd355d Merge remote-tracking branch 'origin/4.15'
Change-Id: I528bff4d19dc4dfcb600e1e18b0d375c232eb417
2021-03-05 17:55:17 +01:00
hjk
2152564329 Utils: Remove BaseAspect base from AspectContainer again
Turns out to get into the way more often than it helps, e.g.
'setAutoApply' operated on the base class' m_autoAspect flag
instead of spreading it over the items in the container.

Change-Id: I2711f2a488d1a6c30ec21d3fc481563cec6e55d4
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-05 06:01:34 +00:00
hjk
8bf6236e90 Utils: Implement SelectionAspect::{setV,v}olatileValue
Change-Id: Ib0b2644c1f7aae651df5af85d35b82f82bc22e8c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-04 13:56:23 +00:00
hjk
0e2445bc54 Valgrind: Aspectify settings
Change-Id: I2fbf8244a05ffb1b642843c6471f92e2b154cf8a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-04 13:37:35 +00:00
hjk
8cfc053c2d Utils: Don't pass updates from IntegerAspect spinboxes through apply
The same pattern as used in DoubleAspect to avoids the asserts on autoapply
state in apply().

Change-Id: Ie06bac7fd8ec24ad461dc932c8eb85fa043a6fb7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-04 11:44:37 +00:00
hjk
60f103b681 Utils: Keep editing position in StringAspects with TextDisplay
Fixes: QTCREATORBUG-25410
Change-Id: I414c90fe679d9f63bfc29361ab753979ff20bfe6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-03 11:40:43 +00:00
hjk
2252b22b10 Utils: Introduce a few AspectContainer convenience functions
Change-Id: I89832ab1971d263e4db9b8be5e89d581fd598b41
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-03 07:39:08 +00:00
hjk
46402f2712 Utils: Disable a QTC_CHECK that legitimately can happen
Change-Id: I63770766796798a4394a031612762dd5b390ab6b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-03 07:26:25 +00:00
hjk
5f2edec6cb Utils: Fix setting up spinbox for IntegerAspect
setValue() has to be called after setRange(), otherwise the value will
by cut at the initial default 99 maximum.

Change-Id: Id4a7cf1db0e3044f32022d6de8f66810f9cd6b4e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-02 07:31:42 +00:00
hjk
deeb845b93 Utils: Introduce an IntegersAspect
Change-Id: I71ed382633ec4527fcb99d3de49e81a01e9c1641
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-01 13:52:41 +00:00
hjk
b7acf45c13 Utils: Make BoolAspects also notify their changed values
... when triggered via base class setValue().

The pattern would probably be useful for other aspects, too, but e.g.
for actions in a menu (like switching on/off FakeVim) this already
covers most cases.

Change-Id: I7886f4b845883edb6d337df0fa53f989ae893f65
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-01 13:50:23 +00:00
hjk
383e756dc3 Utils: Introduce a DoubleAspect
To be used with doubles (and QDoubleSpinbox as representation)

Change-Id: I0ad8ce1e495c48a305a42328c48e226ab3d4278c
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-01 12:47:27 +00:00
hjk
e6fe923392 Utils: Add StringAspect::{append,remove}Value{,s} convenience functions
Change-Id: I3893d9512b7600328e127693da9dc07c771b305a
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-01 12:47:10 +00:00
hjk
60a9529485 Utils: Allow icons to be used for aspect actions
Useful for toggles in tool buttons, as used e.g. in valgrind.

Change-Id: I61f5d4ba86d1f39d0071e4c0e37d2447f408a91e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-01 11:33:17 +00:00
hjk
a5d5887908 Utils: Use the user-set default value when (not) saving values
Change-Id: Iae05d767e28afcfbb581089f6253b633f1aab468
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-01 10:47:38 +00:00
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