Auf dieser Seite

SystemPalette QML Type

Bietet Zugriff auf die Qt-Paletten. Mehr...

Import Statement: import QtQuick

Eigenschaften

Ausführliche Beschreibung

Der Typ „SystemPalette“ ermöglicht den Zugriff auf die Paletten der Qt-Anwendung. Er liefert Informationen zu den Standardfarben, die für Anwendungsfenster, Schaltflächen und andere Elemente verwendet werden. Diese Farben sind in drei Farbgruppen unterteilt: „ active “, „ inactive “ und „ disabled “. Weitere Informationen zu den Farbgruppen und den von „SystemPalette“ bereitgestellten Eigenschaften finden Sie in der Dokumentation unter QPalette.

Dies kann genutzt werden, um Elemente so einzufärben, dass sie ein naturgetreueres Erscheinungsbild erhalten.

Das folgende Beispiel erstellt eine Palette aus der Farbgruppe „ Active “ und verwendet diese, um das Fenster und die Textelemente entsprechend einzufärben:

import QtQuick

Rectangle {
    SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }

    width: 640; height: 480
    color: myPalette.window

    Text {
        anchors.fill: parent
        text: "Hello!"; color: myPalette.windowText
    }
}

Siehe auch „ QPalette “.

Eigenschaftsdokumentation

accent : color [read-only, since 6.7]

Die Akzentfarbe der aktuellen Farbgruppe.

Diese Eigenschaft wurde in Qt 6.7 eingeführt.

Siehe auch QPalette::ColorRole.

alternateBase : color [read-only]

Die alternative Grundfarbe der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

base : color [read-only]

Die Grundfarbe der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

button : color [read-only]

Die Schaltflächenfarbe der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

buttonText : color [read-only]

Die Vordergrundfarbe des Schaltflächentextes der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

colorGroup : enumeration

Die Farbgruppe der Palette. Dies kann eine der folgenden sein:

KonstantBeschreibung
SystemPalette.Active(Standard) QPalette::Active
SystemPalette.InactiveQPalette::Inactive
SystemPalette.DisabledQPalette::Disabled

Siehe auch QPalette::ColorGroup.

dark : color [read-only]

Die dunkle Farbe der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

highlight : color [read-only]

Die Hervorhebungsfarbe der aktuellen Farbgruppe.

Siehe auch QPalette::ColorRole.

highlightedText : color [read-only]

Die Farbe des hervorgehobenen Textes der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

light : color [read-only]

Die helle Farbe der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

mid : color [read-only]

Die mittlere Farbe der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

midlight : color [read-only]

Die Mitteltonfarbe der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

placeholderText : color [read-only, since 6.2]

Die Farbe des Platzhaltertextes der aktuellen Farbgruppe.

Diese Eigenschaft wurde in Qt 6.2 eingeführt.

Siehe auch „ QPalette::ColorRole “.

shadow : color [read-only]

Die Schattenfarbe der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

text : color [read-only]

Die Textfarbe der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

window : color [read-only]

Die Fensterfarbe (allgemeiner Hintergrund) der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

windowText : color [read-only]

Die Farbe des Fenstertextes (allgemeiner Vordergrund) der aktuellen Farbgruppe.

Siehe auch „ QPalette::ColorRole “.

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