aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/layoutbuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Python: Use more direct child widget setup in settingshjk31 hours1-0/+5
| | | | | Change-Id: Ia6abe99d13974c7a448a0baa71503255bf0c7a7b Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Fix LayoutBuilder If/Then/ElseMarcus Tillmanns13 days1-2/+2
| | | | | | | | Without this change an `>> Else {}` will override everything set by the `>> Then {}`` block and vice versa. Change-Id: I59ce99c038064f69cf7b9d7b26e8083acfcf9694 Reviewed-by: hjk <hjk@qt.io>
* Utils: Fix memory leak in Layout::show()Marcus Tillmanns2025-10-271-1/+3
| | | | | | Change-Id: I3d7772e4b58afdfec0e69c4aea3e4af691a2634d Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Lua: QtcTextEdit bindingsLukasz Papierkowski2025-10-201-0/+81
| | | | | Change-Id: I8f5d243747e60553dd770cb6f907382a14ee1d4a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Lua: Fix possible nullptr access in GuiMarcus Tillmanns2025-10-171-0/+14
| | | | | | | | | | | | | | | This patch changes the Thing::ptr to be a QPointer, and adds a onDestroyed field to the Lua bindings. It also adds a function that checks any Thing derived object before accessing it to avoid crashes when the underlying QObject has been deleted, e.g. because it was closed. Since every Thing now has to build a QObject it is no longer useful and is therefore merged into Object. Api: LayoutBuilder::Thing base class has been merged into Object Change-Id: Ie783242e738569cadede81a1c53ea5a8426a796a Reviewed-by: hjk <hjk@qt.io>
* Layouting/Flow: Avoid soft assert if there are no itemsEike Ziller2025-09-101-1/+1
| | | | | | | | | | | | | | If there are no items in the flow layout, it would print an assert "count > 0". An example for flow layouts without buttons are the notifications about connecting remote devices via ICore::popupInfoBar() which do not have any buttons, but the layout for the info item still contains the placeholder Flow layout for them. Amends 31a5c8c0a641f6a2b13eae3571a1cc6e5ff883db Change-Id: Ieaf62257dea35688fccddd4d1660d151b0877b21 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Change 'If' syntax in LayoutBuilderhjk2025-07-071-7/+18
| | | | | | | | | | | | | | | | Instead of If (cond, { then-stuff } [, { else-stuff }) use If (cond) >> Then { then-stuff } >> Else { else-stuff } It's a bit more verbose, but easier to reason about, and more similar to what TaskTree does with When >> Do etc. Change-Id: I0ae69ea566ee42a4e75bcdfc3173e744b812785e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Utils: Add SpanAll helperMarcus Tillmanns2025-05-231-0/+22
| | | | | | | | | | | | | | | | | | The Span modifier originally only added the span attribute to the last item added from its "items" parameter. In some ways that is wrong, as you would expect it to be added to all the items you provide. This behavior is however (mis)used when adding for instance an aspect to a layout which will add a label and an input widget at the same time. Then it is beneficial if the span is only applied to the input element, and not to the label. As a workaround, this patch restores the old behavior and adds a new modifier "SpanAll" that applies the span to all of its items. Amends 515d5dffa4b2d461a74b67aa41c99227005be188 Change-Id: I20f8ca4deeab0d8de283725b3b7af19396a710f7 Reviewed-by: hjk <hjk@qt.io>
* Utils: Add GridCellMarcus Tillmanns2025-05-191-6/+33
| | | | | | | Allows the user to add multiple items to the same cell. Change-Id: Icf706cb3c2267537972ac0848582075ee297c05e Reviewed-by: hjk <hjk@qt.io>
* Utils: Add max Width/Height to layoutbuilderMarcus Tillmanns2025-05-161-0/+10
| | | | | Change-Id: Id607b4fe3a3cf926af4f93feade49440a8cc3f74 Reviewed-by: hjk <hjk@qt.io>
* Utils: Add rowStretch for Grid layoutsMarcus Tillmanns2025-05-151-0/+9
| | | | | Change-Id: Ia77fe3d3a015cc354d0dee283ea7cc345faf5cbf Reviewed-by: hjk <hjk@qt.io>
* Utils: Add fix for QScrollArea::sizeHint bugMarcus Tillmanns2025-05-151-2/+37
| | | | | | Task-number: QTBUG-136762 Change-Id: I197107c03ae7b4f2c3422e213faff7b181b29d19 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Add aligning items in Grid cellsMarcus Tillmanns2025-05-151-1/+22
| | | | | Change-Id: I16e2995d923617817186175e10283070553660b6 Reviewed-by: hjk <hjk@qt.io>
* Utils: Add Canvas widgetMarcus Tillmanns2025-05-151-0/+26
| | | | | | | Allows creating a simple Widget that draws custom graphics with a callback. Change-Id: Ie3e730469af701996f98bb0eef350f81ed97338d Reviewed-by: hjk <hjk@qt.io>
* Utils: Add ScrollArea frameShape propertyMarcus Tillmanns2025-05-151-0/+27
| | | | | | | Also improves the ScrollArea to accept all setter properties. Change-Id: I07437d7ce93a0c991b7a7788efdca3135f57fe2e Reviewed-by: hjk <hjk@qt.io>
* Utils: Add Layouting::replaceLayoutOnMarcus Tillmanns2025-04-291-0/+11
| | | | | Change-Id: I3d01a93eb66d7fb28758c763bdc2c536cae4784f Reviewed-by: hjk <hjk@qt.io>
* Core: Create CoreButton Layouting helperMarcus Tillmanns2025-04-281-13/+2
| | | | | | | | | | Also moves Layouting::apply / Layouting::access to be accessible outside layoutbuilder.cpp. Added test to tst_manual_widgets_layoutbuilder Change-Id: Ie8cb9de2abe5d4fd36d407908f672ee3c025bf43 Reviewed-by: hjk <hjk@qt.io>
* Layouting/Flow: Use layout spacing() for the horizontal spacingEike Ziller2025-04-041-13/+4
| | | | | | | | | Which allows setting the horizontal spacing with `spacing(<value>)`, which is used by the extensions mode for displaying tags and so far didnt have any effect. Change-Id: I385a4444e36762762c064211688cba1d60e4d471 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Layouting/Flow: Fix sizeHint and row size calculationEike Ziller2025-04-041-7/+36
| | | | | | | | | | | | | The right-most x coordinate of an item is "x + width - 1", so that must be used for checking if the item is too large to fit into the row, not "x + width". Change flow layout's size hint to fit all the items. If the flow layout is allowed to request that width, then it should get it. That can still be ignored by the using code, by setting an appropriate sizePolicy. Change-Id: I3bc15d5683ffe2de7d835a757893784d5cef5b88 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Layouting/Flow: Avoid calling virtual method in destructorEike Ziller2025-04-021-3/+2
| | | | | | | We have direct access to the member anyway. Change-Id: Ibc43a39d8da3dca64c2f0d7bb1a175760c957b0b Reviewed-by: hjk <hjk@qt.io>
* Layouting/Flow: Support right alignmentEike Ziller2025-04-021-11/+23
| | | | | Change-Id: I5857278ec2acf3b627908f9b10f21c0d9875e3d1 Reviewed-by: hjk <hjk@qt.io>
* Layouting/Flow: Center items verticallyEike Ziller2025-04-021-3/+24
| | | | | | | | If items with different height are in the same row, center smaller items within the row, similar to QHBoxLayout Change-Id: I333341acf5d23bca8d12b8a3a647c18822d626f5 Reviewed-by: hjk <hjk@qt.io>
* Layouting/Flow: Fix horizontal spacingEike Ziller2025-04-021-9/+17
| | | | | | | | | | It used the PushButton-PushButton spacing regardless of which widgets it actually contained. Add Flow to the LayoutBuilder demo. Change-Id: Ifc0bce37c4f813237d1e727981919d8e43a02f8c Reviewed-by: hjk <hjk@qt.io>
* LayoutBuilder: Add onLinkActivated to LabelEike Ziller2025-03-281-0/+5
| | | | | Change-Id: Ia79792d42a9c27b57fd537bf00728568289ffc71 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Merge remote-tracking branch 'origin/16.0'Eike Ziller2025-03-241-0/+14
|\ | | | | | | Change-Id: I4855dc790ac212f40d98163bbb003699cc76e4fa
| * Lua: Add possibility to insert tool button to toolbarKrzysztof Chrusciel2025-03-191-0/+14
| | | | | | | | | | Change-Id: I3c7c8f7f88cbb84173bff876ac1dd2e3885bea6a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | Merge remote-tracking branch 'origin/16.0'Eike Ziller2025-03-131-0/+5
|\| | | | | | | Change-Id: I466d212f57f706c71fd0c2624abb33814ea3e783
| * Lua: Add viewportMargins option for supported widgetsLukasz Papierkowski2025-03-121-0/+5
| | | | | | | | | | | | Change-Id: If4d6110bd382d459f0e59adcb3159da0f83cea18 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | Utils: Fix "elsecase" parameter nameMarcus Tillmanns2025-03-031-2/+2
|/ | | | | Change-Id: Ibcca5ff23a2114f45f8fbb83028c1c7aad3d7e9b Reviewed-by: hjk <hjk@qt.io>
* Lua: Add source code copy link and icon for MarkdownBrowserLukasz Papierkowski2025-02-281-5/+15
| | | | | Change-Id: I3100c149b47dc503eae191a8a9f2f71b9c2b1b18 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Merge remote-tracking branch 'origin/15.0'Eike Ziller2025-01-161-0/+16
|\ | | | | | | Change-Id: Icedb7d174adc262f3b9d053549195d8ad15f1dd4
| * Lua: Expose stretch function in box layoutArtur Twardy2025-01-151-0/+11
| | | | | | | | | | | | Change-Id: I52bb81e01561950785252d362d31d6142844fcac Reviewed-by: <lie@spyro-soft.com> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
| * Lua: Add minimumWidth property to WidgetOptionsArtur Twardy2025-01-151-0/+5
| | | | | | | | | | | | Change-Id: I7c7ed3fc8b5ac907f9e6fc7ea161d1b263c9a5de Reviewed-by: <lie@spyro-soft.com> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | Merge remote-tracking branch 'origin/15.0'Eike Ziller2024-12-051-0/+6
|\| | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs src/plugins/languageclient/languageclientmanager.cpp src/plugins/languageclient/languageclientmanager.h Change-Id: I5d705abb1dd6b67e7c51c4f9151bf4fe3213004f
| * Lua: Export sizePolicy parameter for WidgetsKrzysztof Chrusciel2024-12-051-0/+6
| | | | | | | | | | | | | | Extend lua bindings to support horizontal and vertical size policies. Change-Id: I663b17bd11086efd2cbf430aace800fde55b6c0d Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | LayoutBuilder: Make the guard the first parameters in "slots"hjk2024-12-021-5/+5
| | | | | | | | | | | | | | | | | | | | This is purely cosmetical: The guard is usually 'this' or another short expression and fits on the same line as the initial parts of the lambda, and is usually "obviously" right. Before it came after a potentially lengthy lambda, leading sometimes to "'this' - huh?" moments when reading. Change-Id: I5fb25cbf971ab54c491ab8cd9515879082af1924 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | Utils: Add default ctors for Layouting::{Row,Column,Flow}hjk2024-11-191-1/+18
| | | | | | | | | | | | | | Helpful when filling a layout manually. Change-Id: Id21a9ce1e280f999699529212a8bf713429524eb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | Merge remote-tracking branch 'origin/15.0'Eike Ziller2024-11-141-1/+23
|\| | | | | | | | | | | | | | | | | Conflicts: src/plugins/android/androiddeployqtstep.cpp src/plugins/debugger/debuggerdialogs.cpp src/plugins/projectexplorer/kitaspect.cpp Change-Id: Iebc1d7a38db4c228282c04c63d7f11ee76072a06
| * Lua: Add setting cursor shape on WidgetArtur Twardy2024-11-141-0/+5
| | | | | | | | | | Change-Id: Iad545dd693a52886101a5fc5a489cc849245c660 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
| * Utils: Let LineEdit accept Enter/ReturnMarcus Tillmanns2024-11-141-1/+18
| | | | | | | | | | | | | | | | | | The base implementation does not accept the keyevent to let it escape to an underlying widget. We want to handle that ourselves, so we accept the event in case there is an callback set. Change-Id: I99050579fe85bb2df0fbf59a9437151bf737d9bd Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/15.0'Eike Ziller2024-11-011-0/+12
|\| | | | | | | Change-Id: I08c3c503ca73f0a1953fae37b979b98eaf380264
| * Add IconDisplay class and expose it to luaArtur Twardy2024-10-311-0/+12
| | | | | | | | | | | | Change-Id: I5cc9725de1666e5e19d869f3249d3b287de8a4b9 Reviewed-by: Artur Twardy <atw@spyro-soft.com> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | Merge remote-tracking branch 'origin/15.0'Eike Ziller2024-10-311-4/+4
|\| | | | | | | Change-Id: I3498229608bca8d3674a77b66fd7c0d26163b53f
| * Lua: Fix for setSizedSize arg typeArtur Twardy2024-10-291-2/+2
| | | | | | | | | | Change-Id: If8e64d9556b44fc2fc440ce8c95bed18e241032f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
| * Utils: Add guard to SpinBox onTextChangedMarcus Tillmanns2024-10-291-2/+2
| | | | | | | | | | Change-Id: I2a29541473f1ad201be45810703e61aff8148827 Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/15.0'Eike Ziller2024-10-281-4/+15
|\| | | | | | | Change-Id: If7914dda9d1cac52ea307310cba5d72faeaf58b6
| * Lua: Add fixedSize to builder propertyArtur Twardy2024-10-251-0/+5
| | | | | | | | | | Change-Id: I5779b91985659899cd17164d91217bce7a5800b9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
| * Lua: Add text setter to LineEditArtur Twardy2024-10-251-0/+5
| | | | | | | | | | Change-Id: I62a75f861ae632ca60e58ebed8bc75ff3d03b04c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
| * Utils: Add missing guardsMarcus Tillmanns2024-10-241-4/+4
| | | | | | | | | | Change-Id: I95c38aac78d1c841f3d7915a6c68511d546a535a Reviewed-by: hjk <hjk@qt.io>
| * Utils: Set ScrollArea to resize content by defaultMarcus Tillmanns2024-10-241-0/+1
| | | | | | | | | | | | Change-Id: Ie6b379b5589d4626240c0f0471171cb122a73942 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Artur Twardy <atw@spyro-soft.com>