IndicatorStyle QML Type
Define el estilo del indicador de un control. Más...
| Import Statement: | import Qt.labs.StyleKit |
| Inherits: |
Propiedades
- down : SubIndicatorStyle
- foreground : DelegateStyle
- up : SubIndicatorStyle
Descripción detallada
IndicatorStyle extiende DelegateStyle con propiedades específicas para dar estilo a un indicador.
El propio IndicatorStyle describe el fondo del indicador, mientras que foreground describe el contenido que se dibuja en su interior. Por ejemplo, checkBox.indicator estiliza el marco de la casilla de verificación y checkBox.indicator.foreground estiliza la marca de verificación. Para switchControl, slider y progressBar, el indicador estiliza la ranura y el primer plano estiliza el relleno.
checkBox { background.visible: false text.alignment: Qt.AlignVCenter | Qt.AlignLeft indicator { color: "transparent" border.width: 1 foreground { color: "transparent" image.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/check.png" // Hide the checkMark when the CheckBox is unchecked visible: false } } checked { // Show the checkMark when the CheckBox is checked indicator.foreground.visible: true } }
Algunos controles tienen más de un indicador. Por ejemplo, SpinBox tiene un botón de incremento y otro de decremento. Se les puede aplicar un estilo independiente utilizando los subindicadores up y down, spinBox.indicator.up y spinBox.indicator.down. Las propiedades no establecidas en un subindicador se aplican al propio indicador.
spinBox { text.alignment: Qt.AlignHCenter | Qt.AlignVCenter padding: 0 indicator { implicitHeight: Style.Stretch color: "navy" opacity: 0.1 foreground { color: "transparent" margins: 10 image.color: "navy" image.fillMode: Image.PreserveAspectFit image.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/arrow-indicator.png" implicitWidth: 10 implicitHeight: 10 alignment: Qt.AlignCenter } down { alignment: Qt.AlignLeft foreground.rotation: 90 } up { alignment: Qt.AlignRight foreground.rotation: -90 } } }
Nota: No se garantiza que los tipos de los módulos Qt.labs sigan siendo compatibles en futuras versiones.
Véase también SubIndicatorStyle, DelegateStyle, ControlStyle, ControlStateStyle, y FallbackStyle Reference.
Documentación de propiedades
down : SubIndicatorStyle
Propiedad agrupada para estilizar el sub-indicador down (decremento). Se utiliza en controles como SpinBox. Las propiedades no agrupadas recaen en el propio indicador.
Véase también up.
foreground : DelegateStyle
Propiedad agrupada para dar estilo al elemento en primer plano de este indicador. Por ejemplo, checkBox.indicator describe el marco de la casilla de verificación, mientras que checkBox.indicator.foreground es la marca de verificación.
Para controles como slider, progressBar, y switchControl, el indicator.foreground representa la pista de progreso o relleno dentro del surco, mientras que el indicator representa el surco.
up : SubIndicatorStyle
Propiedad agrupada para estilizar el subindicador up (incremento). Se utiliza en controles como SpinBox. Las propiedades Unset recaen en el propio indicador.
Véase también down.
© 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.