Commit Graph

49 Commits

Author SHA1 Message Date
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
hjk
b97c495d2b Utils: Make the second parameter to LayoutBuilder::attach() an enum
More explicit and more potential options (e.g. "treat grid as form")
than a bool.

Change-Id: I89413efe30410160c38b0e524ba64288dde2332e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-26 11:52:16 +00:00
hjk
4a95f693fb Utils: Tiny simplification in LayoutBuilder::Group implementation
Originally we needed the real type of the widget for a while.
Not anymore.

Change-Id: Ida7e3eb4b091baee90d510c5f6ec05bbcedfc11f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-26 09:09:16 +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
hjk
14257a24f9 Utils: Introduce Layouting::{br,st}
... as "standard" ways to define line breaks and simple stretch.

There have already been too many patterns to do it.

Break() and Stretch() still work for the patches in flight, but
they are planned to be removed.

Change-Id: I9b70dcdc11244a904a496b0c55938dfb0b265fc8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-25 09:52:15 +00:00
hjk
ba51e3acac Utils: Make Layouting::Title even less special
This goes a bit in the direction of property settigs for
arbitrary layout items.

Change-Id: I98500e213e3b22cc99038a1bcf688183588be248
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-22 14:41:20 +00:00
hjk
b8a6d72137 Utils: Make Layouting::Group { .. } less weird
It had a implicit vertical layout leading to unneded layout nesting
in quite a few cases. The price is an added Column { ... } in those
places where the implicit vertical layout was sufficient before.

Change-Id: I3ae1f03f9c1d691bd0c563b0447edd03ee02bbd2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-22 07:43:23 +00:00
Eike Ziller
70cfa63cb4 Core: Inline systemsettings.ui
And convert text to QLabel for "Grid" layout too.

Change-Id: I50488462f8795337a2cd59fc88bb9834d988912d
Reviewed-by: hjk <hjk@qt.io>
2022-07-21 08:16:04 +00:00
hjk
e7f18d9d14 Utils: Do not use fixed values for margins in LayoutBuilder
Change-Id: I4af69c149fc1e71134ac6dd5de9a9428c9d3d73d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-20 11:48:41 +00:00
hjk
71ec25895f Utils: Centralize adding layoutitems in LayoutBuilder
As a side-effect, this fixes adding stretch and space in the the dummy
vboxes for formlayout fields with more than two items that was
accidentally missing before.

Change-Id: I18e4755ccd3cd9e1de761b70dc621b17376277dc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-15 12:05:08 +00:00
hjk
11deab03a9 Utils: Set up form layout buddies automatically in LayoutBuilder
Change-Id: I79e523f7847258a43ffe263f80c52983651aa34d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-15 10:11:59 +00:00
Jarek Kobus
ed40753ed1 Utils: Drop unused headers [I-Z]
Round 2 - focus on sources.
For classes with initial in range [I-Z].
Try to keep the same separators between different kind of headers.

Change-Id: I8a7ab99bab8120ee72cda6433ee3dc6f260a4d76
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 07:49:25 +00:00
Eike Ziller
209ecc91a0 CMake: Fix configurations tab bar appearance
A tab bar should span completely above the group that it "tabs", and
have no spacing to it. Otherwise there are funny visual artifacts, and
the visual correspondance is not clear.

Add an option for spacing to LayoutBuilder for that.

Change-Id: I5ca9dc713fff95599c9ec1cf90abe8473bc67c2a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-16 13:38:41 +00:00
Sergey Levin
44ff85cb1b Change QLabel from StringAspect to ElidingLabel
ElidingLabel with elided mode set other than Qt::ElideNone will not show
in case QFormLayout has QFormLayout::ExpandingFieldsGrow field growth
policy

Change-Id: I26db57fbeb2c921e054cf7dc18229ebddcb04530
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-12-08 12:53:19 +00:00
hjk
ba06114afa Utils: Improve handling of BoolAspects used for checked QGroupBoxes
Make the group box a registered subwidget of the BoolAspect, so it
properly triggers the necessary behavior in BaseAspect::isDirty.

Change-Id: I9f6291d87ef7ce4067e0d235de8b5be24de79a93
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-06 11:28:08 +00:00
hjk
baa794a7ba Utils: Use a full layout row for an aspect for Columns and Forms
Avoids some boilerplate on the user code side.

This seems to be the only existing case. If there'd ever be a case where
this is not appropriate, an extra Row { ... } would solve it.

Change-Id: I1ae1102e895640c0acc03b4949e3baabecfcdc49
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-25 04:53:05 +00:00
hjk
62974b0ad9 Subversion: Aspectify settings
Change-Id: I60a563511fce2e6487e8050541cedb086b0ab4e1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-22 06:42:08 +00:00
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
687597152e LayoutBuilder: Introduce markers for space and stretch
... and groupbox titles.

Change-Id: Ie57d7857230692f599de8d362c570b9163626dee
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-02 12:31:14 +00:00
hjk
434c624b6f LayoutBuilder: Add support for VBoxLayout and HBoxLayout
Change-Id: Ieeef8244a05ffb1b642843c6471f92e2b154cf8a
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-26 13:29:31 +00:00
hjk
7527bbcf2c ProjectExplorer: Move KitAspect related layout code
... from KitManagerConfigWidget to KitAspectWidget (which is not
really a widget, but...)

The modification for the alignment handling only affect this use
here. Long term I hope this can be handled centrally (e.g. always
use the special form label alignment for labels in the first column
when some LayoutBuilder bool property is set, instead of doing that
for each use), so this is not necessarily a final API.

Change-Id: I678dba45ee68ca9706569715d232f98363de8636
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-09 09:05:57 +00:00
hjk
bc4e76f76b Revert "Utils: Remove the text option for LayoutItem"
This reverts commit 5154e1eb02.

For some yet unknown reason, this renders the whole sublayout read-only.

Change-Id: Ide1587382392a57643bed1b3cdd7d8987dbdab57
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-28 15:11:49 +00:00
hjk
5154e1eb02 Utils: Remove the text option for LayoutItem
This is converted to QLabels on the Qt side anyway, so we can can
just do that and avoid the special casing later for form layouts
later and gain the functionality for grids.

Use the opportunity to make the all mouse-selectable.

Change-Id: I37830b028b8d2987ea4925f364c79e905be725c8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-28 08:40:29 +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
4907ad090a Utils: Fix warning when destroying a grid-based LayoutBuilder
Change-Id: I816133b6b26ecaf546484b93dbc95666910f992a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-23 10:21:07 +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