StyleKit QML Type
Um singleton para definir e acessar o estilo atual. Mais...
| Import Statement: | import Qt.labs.StyleKit |
| Status: | Technology preview |
Este tipo está em pré-visualização tecnológica e está sujeito a alterações.
Propriedades
- debug : StyleKitDebug
- style : Style
- styleUrl : url
- transitionsEnabled : bool
Métodos
- bool styleLoaded()
Descrição detalhada
StyleKit é um singleton para definir o ` Style` do aplicativo.
// Main.qml
import QtQuick
import Qt.labs.StyleKit
ApplicationWindow {
id: app
width: 1024
height: 800
visible: true
// Assign the style to be used
StyleKit.style: PlainStyle {}
// Controls are used as normal
Column {
anchors.fill: parent
anchors.margins: 10
spacing: 10
Button {
text: "Button"
}
Slider {
width: 200
}
}
}Ele também fornece propriedades para configuração global do StyleKit e depuração.
Observação: não há garantia de que os tipos nos módulos do Qt.labs permanecerão compatíveis em versões futuras.
Veja também Style e StyleVariation.
Documentação das propriedades
debug : StyleKitDebug [read-only]
Uma ferramenta de depuração em tempo de execução que pode ser usada para rastrear propriedades de estilo de um Control específico.
style : Style
O estilo ativo do aplicativo.
Defina-o como uma instância de ` Style ` para aplicá-lo a todos os controles `Qt Quick `.
// Main.qml
import QtQuick
import Qt.labs.StyleKit
ApplicationWindow {
id: app
width: 1024
height: 800
visible: true
// Assign the style to be used
StyleKit.style: PlainStyle {}
// Controls are used as normal
Column {
anchors.fill: parent
anchors.margins: 10
spacing: 10
Button {
text: "Button"
}
Slider {
width: 200
}
}
}Observação: para obter o melhor desempenho na inicialização, defina o estilo no ApplicationWindow raiz, antes de quaisquer controles filhos.
Veja também ` styleUrl ` e ` Style`.
styleUrl : url
Uma alternativa ao ` style ` que carrega um ` Style ` a partir de uma URL.
Veja também style.
transitionsEnabled : bool
Determina se as transições estão habilitadas globalmente.
Defina como ` false ` para desativar todas as transições no estilo atual.
O valor padrão é ` true`.
Veja também ` ControlStyle::transition`.
Documentação do método
bool styleLoaded()
Retorna ` true ` quando o ` style ` ativo e seu ` theme ` atual tiverem concluído o carregamento. Isso pode ser usado para adiar a lógica de inicialização que depende de propriedades de estilo já resolvidas.
© 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.