StyleKit QML Type
Ein Singleton zum Setzen und Abrufen des aktuellen Stils. Mehr...
| Import Statement: | import Qt.labs.StyleKit |
Eigenschaften
- debug : StyleKitDebug
- style : Style
- styleUrl : string
- transitionsEnabled : bool
Methoden
- bool styleLoaded()
Ausführliche Beschreibung
StyleKit ist ein Singleton für die Einstellung der Anwendung Style.
// 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 } } }
Es bietet auch Eigenschaften für die globale StyleKit-Konfiguration und das Debugging.
Hinweis: Es ist nicht garantiert, dass Typen in Qt.labs-Modulen in zukünftigen Versionen kompatibel bleiben.
Siehe auch Style und StyleVariation.
Dokumentation der Eigenschaften
debug : StyleKitDebug [read-only]
Ein Laufzeit-Debugging-Tool, das verwendet werden kann, um Stileigenschaften für eine bestimmte Control zu verfolgen.
style : Style
Der aktive Stil für die Anwendung.
Setzen Sie diesen auf eine Style Instanz, um ihn auf alle Qt Quick Controls anzuwenden.
// 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 } } }
Hinweis: Um die beste Startleistung zu erzielen, setzen Sie den Stil auf die Wurzel ApplicationWindow, vor allen untergeordneten Steuerelementen.
Siehe auch styleUrl und Style.
styleUrl : string
Eine Alternative zu style, die eine Style von einer URL lädt.
Siehe auch style.
transitionsEnabled : bool
Steuert, ob Übergänge global aktiviert sind.
Setzen Sie diesen Wert auf false, um alle Übergänge im aktuellen Stil zu deaktivieren.
Der Standardwert ist true.
Siehe auch ControlStyle::transition.
Dokumentation der Methode
bool styleLoaded()
Gibt true zurück, wenn sowohl das aktive style als auch sein aktuelles theme das Laden beendet haben. Dies kann verwendet werden, um die Initialisierungslogik aufzuschieben, die von aufgelösten Stileigenschaften abhängt.
© 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.