Commit Graph

76 Commits

Author SHA1 Message Date
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
Marcus Tillmanns
413fda678f Utils: Add "layouting" widgets to layoutbuilder
This allows us to handle widgets that have an "addWidget" function.

Change-Id: Id1b63bae7032403fdd3c5e6ba60283cf56cc1cfe
Reviewed-by: hjk <hjk@qt.io>
2023-10-12 10:32:56 +00:00
Marcus Tillmanns
db8d82e51e Utils: Change Stack to QStackedWidget
We use a QStackedWidget instead of a QStackedLayout here because the
latter will call "setVisible()" when a child is added, which can lead to the
widget being spawned as a top-level widget. This can lead to the focus
shifting away from the main application.

Change-Id: I4746de2ea1a300d7c97735f0bbd9338cd2818b5d
Reviewed-by: hjk <hjk@qt.io>
2023-10-12 10:32:51 +00:00
Marcus Tillmanns
644e88ae2e Utils: Emerge widgets from LayoutItem
This allows us to call e.g. PushButton{}.emerge(); without having to
add another unnecessary layout.

Change-Id: Ica26f4776dee1843e1f40c238e1f3c1a54d14ea5
Reviewed-by: hjk <hjk@qt.io>
2023-10-12 10:32:44 +00:00
Marcus Tillmanns
da03156259 Utils: Allow nullptr widgets in layouts
Change-Id: I33ee85bd809a3388872bee4a470e9439010ed8a8
Reviewed-by: hjk <hjk@qt.io>
2023-10-12 06:31:08 +00:00
hjk
123793fbb1 Utils: Add an 'If' LayoutItem
Change-Id: I700e28d03b6dc39e96fa969152f236760989bdb7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-15 13:03:11 +00:00
Marcus Tillmanns
abf2234e4f Utils: Add ToolBar to layoutbuilder
Change-Id: I26ce85f73e625508d816c0e361a6afc65adf65ff
Reviewed-by: hjk <hjk@qt.io>
2023-07-11 11:37:23 +00:00
Eike Ziller
26e96bfad8 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	src/plugins/debugger/debuggeritemmanager.cpp

Change-Id: I9d99d13feff9315f52eacbd84857c63cb69bf804
2023-07-03 10:24:09 +02:00
Marcus Tillmanns
83111bb3f6 Utils: Make validation async
Changes FancyLineEdit to accept two types of validation functions:

AsyncValidationFunction, which returns a QFuture and takes the new text,
or SynchronousValidationFunction.

Especially PathChooser is changed to use async validation function to
improve snappyness of settings pages that do heavy validation,
for instance the Debugger page.

Change-Id: I1677e7d8acc29e36c69a867850304b7913e6ae7e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-06-29 13:25:03 +00:00
Christian Stenger
49dc14995a Utils: Silence soft assert
Change-Id: I8c21588e203b2446320009b77161b3951ba790f9
Reviewed-by: hjk <hjk@qt.io>
2023-06-28 07:17:53 +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
125e345e2e Utils: Make a lot of labels mouse-selectable
Change-Id: I2c17cfeeab9fb9e15d15902ecd1f6c8921dc1464
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-20 08:01:50 +00:00
Alessandro Portale
6b04989fce Utils: Introduce customMargin(const QMargins &)
And re-use it for normalMargin() and noMargin()

Change-Id: Id779e2fa052ab35df3dd917d890ca7808dfb1a8c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-06-06 08:08:01 +00:00
Leena Miettinen
83b971b238 Doc: Mark docs in Utils \internal if classes or functions not found
Change-Id: I3182534fefc51f573892d6f80f59ce5613f95fdc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-26 07:24:22 +00:00
Leena Miettinen
b6a1935562 Doc: Fix qdoc warning caused by a changed argument name
Change-Id: Id2f28994f6cd1829bfc4bdc23c87aabe40f44f2c
Reviewed-by: hjk <hjk@qt.io>
2023-05-23 12:44:10 +00:00
Leena Miettinen
f776f6f3ec Doc: Add Layouting namespace to make its classes' docs visible
Change-Id: I3b713f4c9bd65f279e41368ce5ce1a25ea17f176
Reviewed-by: hjk <hjk@qt.io>
2023-05-23 07:22:36 +00:00
hjk
77c19ae213 Utils: Add minimal Flow layout support to layout builder
It will be used in the CppCheck option page.

The de-facto copy of utils/flowlayout.{cpp,h} is intentional
to keep the layout builder usable stand-alone.

Change-Id: Ibda3ece2aeb3cbb1badaf6083b52ebb63b6524ac
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-16 15:03:41 +00:00
hjk
ed6f5e3486 Layouting: Add a plain 'Widget' item
Change-Id: Id419b1efd56f51fb282b11c4b241b96eb7d7d0ae
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-12 11:21:15 +00:00
Alessandro Portale
2196e08295 LayoutBuilder: Avoid leak warnings in Application::exec()
Change-Id: I9c05f3015b120220408076d58d29983d2194d9e1
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 10:15:35 +00:00
hjk
d7781c16f7 Layouting: Remove some now unused functions
Change-Id: I9e91bdbf68c38da22bd2378cb7d9596306bbb413
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-10 07:36:33 +00:00
hjk
2e7930b56e LayoutBuilder: Rename Id to ID
The Id was only used in the demo. "ID" is Not exactly canonical naming,
but this clashes often with Utils::Id, so mis-spell until we settle on a
proper name.

Change-Id: I6fdf806c41abf224f7422ec6c9263db3eb357190
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 04:59:13 +00:00
hjk
e7397ec576 LayoutBuilder: Fix Splitter construction
QSplitter is different insofar as that it doesn't have a Layout,
but a list of child widgets.

Change-Id: I4e1076e39d20df409c4bab93d79770b6d0e5aa8d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 04:58:42 +00:00
hjk
62f3d29be4 Layouting: Introduce Ids for Items
Intenally just wrapping a 'bindTo' result, but less trigger potential
for pointer related peladophobia

Change-Id: I25171a2675fb0474ce97c04552ac1cf5ffd6ee56
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 15:08:23 +00:00
hjk
652e99830f Layouting: Add some support for spin boxes
Change-Id: I5eff963cf605f5239a96daee924e91b2c170f506
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-05 13:08:40 +00:00
hjk
1c34fc7bca Layouting: Fix advancing by empty cells
Change-Id: I404e80e98a8fa53e174a8a372b82e17e8187a52c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-05 11:59:06 +00:00
hjk
328d4c7295 Layouting: Code cosmetics
Change-Id: I0eea49bc5c39679ca66f73616a98e91546e493c2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-05 08:21:34 +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
50084f6b0e Layouting: Handle attach types via setter
Change-Id: I862f5cd109db3582b4f029787ec0cded2da39ce6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:19 +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
1c2b29b31a Layouting: Introduce a 'bindTo' LayoutItem
... to 'export' the widget being operated on.

The 'Tab' related changes are related, as they affect the order
of execution.

Change-Id: I7aa079f12e49a1dab7c6a49acfae9dc684cfb479
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>
2023-05-02 11:44:03 +00:00
hjk
fbe9366498 LayoutBuilder: Cut remaining dependency to utils
layoutbuilder.{cpp,h} can now be re-used outside Creator

Change-Id: I306d2d8168d8a09658ea008f4606ca37a0dbbc01
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-02 07:40:55 +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
e18c1dceb2 Layouting: Add QTextEdit
Change-Id: I3a74dce8ee7874b73cb11acab52092c4053722b8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-26 13:05:48 +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
b7ca84c5ee Utils: Remove one LayoutBuilder::addRow() overload
The flexibility here is getting in the way later when trying to
remove the dependency on aspects.

Change-Id: I7221e80f2067292c7c80aead8f6d739fb7878f7e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 10:07:26 +00:00
Christian Stenger
73c2c86c61 Utils: Fix unintended comment
Fixes various settings layouts.
Amends 642c593481.

Change-Id: I00351e60b8bee6f67fc5a8f35d5df983a63d13b3
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-23 09:45:56 +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
hjk
0454e939e1 Utils: Make all labels created by the LayoutBuilder
... selectable with the mouse.

Change-Id: Ied2677a517239ca55a15daeae088bc09998d2b3b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-19 12:03:32 +00:00
Alessandro Portale
e78f0b5911 LayoutBuilder: Turn Splitter into a LayoutItem
Change-Id: I05bdadf7f79966e215b4999db9c2f96cd8f67f9f
Reviewed-by: hjk <hjk@qt.io>
2023-01-11 14:05:46 +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
Jarek Kobus
d21acbd413 LayoutBuilder: Add support for tab widget
Change-Id: Ia35fa234c8ac1befd7e8fd2be57998e94294a5a1
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 15:30:49 +00:00
Marcus Tillmanns
9eef925133 docker: Improve Docker Device Wizard
* Added Sorting of Images
* Added "Double-click to accept"
* Added "disable list until sucessful"
* Added "Show unnamed Images" option
* Added Loading indicator

Change-Id: I9bb822753ffc8af1d2e54f5279a6884cb5c4f1b0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-06 10:56:05 +00:00
hjk
373032925d Utils: Use 'hr' for horizontal rule in layouts
More HTML-ish.

Change-Id: I45d2e474b2810f00422a03603aac125c6f845b81
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-30 11:21:23 +00:00
Alessandro Portale
912b016ab0 Utils: Add "Layouting::HorizontalRule" LayoutItem
We have many horizontal separator lines in the UI, which are each time
repetitively created from a QFrame with some flags set. With the .ui
inlining, we will have more of these separators coming.

This change intoduces a Layouting::HorizontalRule LayoutItem and
replaces various existing QFarme separators with it.

Change-Id: I60bad89e2a2b777fbd2f9d0cf872af81e41dcfd7
Reviewed-by: hjk <hjk@qt.io>
2022-08-29 15:30:25 +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
3c9aa364ec Utils: Make LayoutBuilder::Setter a LayoutItem
Weird, but makes GroupBox implementation less special and allows
several setters without resorting to using extra {...} there,
which would be needed e.g. for title _and_ toolTip.

Change-Id: Ie0e64a7bae15825292a473a1e973817be5c27fc4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-22 13:32:01 +00:00
hjk
c02af3dd0e Utils: Introduce a Layouting::WithFormAlignment AttachType
Useful for layouts that should appear as forms but are using
QGridLayout for further alignment in the fields as e.g.
the Kit settings does.

Change-Id: Iec3195b1528dfe052eed5a34379a946db6bf8e54
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-22 07:18:22 +00:00
hjk
fee3a1dc78 Utils: Add a PushButton object to LayoutBuilder
Change-Id: I1ed0fd9a940fcaa5361a7d619a5d316f646332b1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-10 14:23:53 +00:00
hjk
58c5b126d3 Utils: Settle on lowerSnakeCase for LayoutBuilder::Setter
Change-Id: Icfe487d8c7712cc8ad28f0f61e8ae4778a356fc3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-27 08:40:12 +00:00