In questa pagina

StyleKit QML Type

Un singleton per impostare e accedere allo stile corrente. Altro...

Import Statement: import Qt.labs.StyleKit
Status: Technology preview

Questo tipo è in anteprima tecnologica ed è soggetto a modifiche.

Proprietà

Metodi

Descrizione dettagliata

StyleKit è un singleton che consente di impostare l'Style e dell'applicazione.

// 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
        }
    }
}

Fornisce inoltre proprietà per la configurazione globale di StyleKit e per il debug.

Nota: non è garantita la compatibilità dei tipi nei moduli Qt.labs nelle versioni future.

Vedi anche Style e StyleVariation.

Documentazione delle proprietà

debug : StyleKitDebug [read-only]

Uno strumento di debug in fase di esecuzione che può essere utilizzato per tracciare le proprietà di stile di una specifica Control.

style : Style

Lo stile attivo per l'applicazione.

Impostare questo valore su un'istanza di Style per applicarlo a tutti i controlliQt 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
        }
    }
}

Nota: per ottenere le migliori prestazioni all'avvio, impostare lo stile sull'ApplicationWindow radice, prima di qualsiasi controllo figlio.

Vedi anche styleUrl e Style.

styleUrl : url

Un'alternativa a style che carica un Style da un URL.

Vedi anche style.

transitionsEnabled : bool

Determina se le transizioni sono abilitate a livello globale.

Impostare questo valore su false per disabilitare tutte le transizioni nello stile corrente.

Il valore predefinito è true.

Vedi anche ControlStyle::transition.

Documentazione sui metodi

bool styleLoaded()

Restituisce ` true ` quando sia l'style attivo che il relativo ` theme ` corrente hanno completato il caricamento. Ciò può essere utilizzato per differire la logica di inizializzazione che dipende dalle proprietà di stile risolte.

Vedi anche style e theme.

© 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.