ToolBarLayout QML Type
An item that creates delegates for actions and lays them out in a row. More...
Import Statement: | import org.kde.kirigami.layouts |
Inherits: |
Properties
- actions : list<QtObject>
- alignment : Qt.Alignment
- fullDelegate : Component
- hiddenActions : list<QtObject>
- iconDelegate : Component
- layoutDirection : Qt.LayoutDirection
- minimumWidth : real
- moreButton : Component
- separatorDelegate : Component
(since 6.7)
- spacing : real
- visibleWidth : real
Attached Properties
- action : QtObject
Methods
- void relayout()
Detailed Description
This effectively combines RowLayout and Repeater in a single item, with the addition of some extra performance enhancing tweaks. It will create instances of fullDelegate and itemDelegate for each action in actions. These are then positioned horizontally. Any action that ends up being placed outside the width of the item is hidden and will be part of hiddenActions.
The items created as delegates are always created asynchronously, to avoid creation lag spikes. Each delegate has access to the action it was created for through the action attached property.
Property Documentation
actions : list<QtObject> |
The actions this layout should create delegates for.
alignment : Qt.Alignment |
How to align the delegates within this layout.
When there is more space available than required by the visible delegates, we need to determine how to place the delegates. This property determines how to do that. Note that the moreButton, if visible, will always be placed at the end of the layout.
fullDelegate : Component |
A component that is used to create full-size delegates from.
Each delegate has three states, it can be full-size, icon-only or hidden. By default, the full-size delegate is used. When the action has the DisplayHint.IconOnly hint set, it will always use the iconDelegate. When it has the DisplayHint.KeepVisible hint set, it will use the full-size delegate when it fits. If not, it will use the iconDelegate, unless even that does not fit, in which case it will still be hidden.
A list of actions that do not fit in the current view and are thus hidden.
iconDelegate : Component |
A component that is used to create icon-only delegates from.
See also fullDelegate.
layoutDirection : Qt.LayoutDirection |
Which direction to layout in.
This is primarily intended to support right-to-left layouts. When set to LeftToRight, delegates will be layout with the first item on the left and following items to the right of that. The more button will be placed at the rightmost position. Alignment flags work normally.
When set to RightToLeft, delegates will be layout with the first item on the right and following items to the left of that. The more button will be placed at the leftmost position. Alignment flags are inverted, so AlignLeft will align items to the right, and vice-versa.
minimumWidth : real |
The minimum width this layout can have.
This is equal to the width of the moreButton.
moreButton : Component |
A component that is used to create the "more button" item from.
The more button is shown when there are actions that do not fit the current view. It is intended to have functionality to show these hidden actions, like popup a menu with them showing.
separatorDelegate : Component |
A component that is used to create separator delegates from.
This property was introduced in 6.7.
See also fullDelegate.
spacing : real |
The amount of spacing between individual delegates.
visibleWidth : real |
The combined width of visible delegates in this layout.
Attached Property Documentation
ToolBarLayout.action : QtObject |
The action this delegate was created for.
Method Documentation
void relayout() |
Queue a relayout of this layout.
Note: The layouting happens during the next scene graph polishing phase.