ToolBar QML Type
Contenedor para controles sensibles al contexto. Más...
| Import Statement: | import QtQuick.Controls |
| Inherits: |
Propiedades
- position : enumeration
Descripción detallada
ToolBar es un contenedor de acciones y controles de toda la aplicación y sensibles al contexto, como botones de navegación y campos de búsqueda. ToolBar se utiliza habitualmente como header o footer de ApplicationWindow.
ToolBar no proporciona un diseño propio, sino que requiere que se coloque su contenido, por ejemplo creando un RowLayout. Si sólo se utiliza un único elemento dentro de ToolBar, éste cambiará de tamaño para ajustarse al tamaño implícito de su elemento contenido. Esto la hace especialmente adecuada para su uso junto con diseños.

ApplicationWindow { visible:true header: ToolBar { RowLayout { anchors.fill: parent ToolButton { text: qsTr("‹") onClicked: stack.pop() } Label { text: "Title" elide: Label.ElideRight horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter Layout.fillWidth: true } ToolButton { text: qsTr("⋮") onClicked: menu.open() } } } StackView { id: stack anchors.fill: parent } }
Véase también ApplicationWindow, ToolButton, Personalización de la Barra de Herramientas, y Controles Contenedores.
Documentación de Propiedades
position : enumeration
Esta propiedad contiene la posición de la barra de herramientas.
Nota: Si la barra de herramientas se asigna como cabecera o pie de página de ApplicationWindow o Page, la posición apropiada se establece automáticamente.
Valores posibles:
| Constante | Descripción |
|---|---|
ToolBar.Header | La barra de herramientas está en la parte superior, como cabecera de ventana o de página. |
ToolBar.Footer | La barra de herramientas está en la parte inferior, como pie de ventana o pie de página. |
El valor por defecto es específico del estilo.
Véase también ApplicationWindow::header, ApplicationWindow::footer, Page::header, y Page::footer.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.