MauiKit Controls
ToolBar.qml
32 * @brief An alternative to QQC2 ToolBar, with a custom horizontal layout - divided into three main sections - left, middle and right.
36 * <a href="https://doc.qt.io/qt-6/qml-qtquick-controls-toolbar.html">This control inherits from QQC2 ToolBar, to checkout its inherited properties refer to the Qt Docs.</a>
53 * The ToolBar sections are divided into five [5] sections, and each one can be easily populated via the alias property. The left and right areas are have two sections, the far-left and far-right, alongside with the left and right.
60 * And lastly there's the middle section - the middle section contents can be centered using the Layout attached properties.
61 * When the left and right contents are not equal in size, the middle content can be forced to be centered using the force center property.
65 * @note The ToolBar sections divided by colors. The middle section [green] is filling the available space.
67 * The bar contents will become flickable/scrollable when the child items do not fit in the available space. There will be shadows indicating that there is content to be discovered to the left or right sides.
70 * If the application window is using CSD - there is a useful property to allow dragging and moving the window by pressing the toolbar area. This can also be disabled if it is undesired.
74 * The middle section is handled by a RowLayout, so child items placed in there can be positioned using the Layout attached properties, such as Layout.fillWidth, Layout.alignment, etc.
76 * The other sections will take the size of child items, so any item place into them need to have an implicit size or explicitly set one.
78 * The far left/right sections will not be hidden when the contents of the bar does not fit and becomes scrollable, They will remain in place, so place items in those section which are important to stay always visible, and do not over populate them, instead populate the left and right areas.
81 * @note Here the contents of the bar does not fit, so it becomes hidden and can be scrolled/flicked horizontally.
114 * @note This control supports the attached Controls.showCSD property to display the window control buttons when using CSD.
118 * @note Using the example as the footer of a page, ToolButtons are placed in the different sections.
123 id: control
128 * @brief By default any child item of the ToolBar will be positioned at the left section in a row. So using the leftContent property or just declaring the child items without it will have the same effect.
134 * @brief Set the preferred height of the toolbar. This is the preferred way to set a custom height, instead of setting it up explicitly via the height property. This is used, for example, on the Page control for the pull-back bars feature.
139 * @brief Forces the middle content to be centered by adding extra space at the left and right sections to match the maximum width, so both left/right side have the same width.
144 * @brief Alias to add items to the left section. Multiple items can be added, separated by a coma and wrapped in brackets [].
164 * @brief Alias to add items to the middle section. Multiple items can be added, separated by a coma and wrapped in brackets [].
165 * The container used to host the child items is a ColumnLayout, so child items need to be positioned using the Layout attached properties.
171 * @brief Alias to add items to the right section. Multiple items can be added, separated by a coma and wrapped in brackets [].
177 * @brief Alias to add items to the far left section. Multiple items can be added, separated by a coma and wrapped in brackets [].
183 * @brief Alias to add items to the far right section. Multiple items can be added, separated by a coma and wrapped in brackets [].
189 * @brief The container for the middle section. Some of its properties can be tweaked, such as the spacing and visibility.
195 * @brief The container for the left section. Some of its properties can be tweaked, such as the spacing and visibility.
201 * @brief The container for the right section. Some of its properties can be tweaked, such as the spacing and visibility.
207 * @brief The container for the far right section. Some of its properties can be tweaked, such as the spacing and visibility.
213 * @brief The container for the far left section. Some of its properties can be tweaked, such as the spacing and visibility.
232 readonly property int count : leftContent.length + middleContent.length + rightContent.length + farLeftContent.length + farRightContent.length
237 readonly property int visibleCount : leftRowContent.visibleChildren.length + middleRowContent.visibleChildren.length + rightRowContent.visibleChildren.length + farLeftRowContent.visibleChildren.length + farRightRowContent.visibleChildren.length
425 // readonly property int mwidth : visible ? Math.max((rightRowContent.implicitWidth + farRightRowContent.implicitWidth) - (leftRowContent.implicitWidth + farLeftRowContent.implicitWidth), 0) : 0
457 // readonly property int mwidth : visible ? Math.max(( leftRowContent.implicitWidth + farLeftRowContent.implicitWidth) - (rightRowContent.implicitWidth + farRightRowContent.implicitWidth), 0) : 0
An alternative to QQC2 ToolBar, with a custom horizontal layout - divided into three main sections - ...
Definition ToolBar.qml:115
int count
The total amount of items in the toolbar sections, items can be non-visible and sum-up.
Definition ToolBar.qml:217
bool forceCenterMiddleContent
Forces the middle content to be centered by adding extra space at the left and right sections to matc...
Definition ToolBar.qml:131
alias fits
If the contents width is currently smaller then the available area it means that it fits,...
Definition ToolBar.qml:212
int visibleCount
The total amount of visible items in the tool bar sections.
Definition ToolBar.qml:222
bool draggable
Allow to move the window around by dragging from the toolbar area.
Definition ToolBar.qml:227
alias content
By default any child item of the ToolBar will be positioned at the left section in a row.
Definition ToolBar.qml:123
alias layout
The ColumnLayout that contains all the sections of the toolbar.
Definition ToolBar.qml:207
QString name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:57:11 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:57:11 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.