Button QML Type
Botón en el que se puede hacer clic para ejecutar un comando o responder a una pregunta. Más...
| Import Statement: | import QtQuick.Controls |
| Inherits: | |
| Inherited By: |
Propiedades
- flat : bool
- highlighted : bool
Descripción detallada
El control «Botón» es un control pulsador que el usuario puede pulsar o hacer clic. Los botones se utilizan normalmente para realizar una acción o para responder a una pregunta. Los botones más habituales son «Aceptar», «Aplicar», «Cancelar», «Cerrar», «Sí», «No» y «Ayuda».
El control «Button» hereda su API de ` AbstractButton`. Por ejemplo, puedes establecer ` text`, mostrar un icono y reaccionar a ` clicks ` utilizando la API ` AbstractButton `.
Un botón emite la señal clicked() cuando el usuario lo activa. Conéctate a esta señal para ejecutar la acción del botón. Los botones también proporcionan las señales canceled(), doubleClicked(), pressed(), released() y pressAndHold() para pulsaciones prolongadas.
Consulta el fragmento de código siguiente para saber cómo conectarte a las señales del botón.
RowLayout {
Button {
text: "Ok"
onClicked: model.submit()
}
Button {
text: "Cancel"
onClicked: model.revert()
}
}Véase también «Personalización de los controlesButton y Button».
Documentación de propiedades
flat : bool
Esta propiedad indica si el botón es plano.

Normalmente, un botón plano no muestra fondo a menos que se pulse o se marque.
El valor por defecto es « false ».
highlighted : bool
Esta propiedad se mantiene independientemente de si el botón está resaltado.

Un botón puede resaltarse para llamar la atención del usuario. No tiene ningún efecto sobre la interacción con el teclado.
El valor por defecto es « false ».
© 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.