SystemPalette QML Type

Provides access to the Qt palettes. More...

Import Statement: import QtQuick

Properties

Detailed Description

The SystemPalette type provides access to the Qt application palettes. This provides information about the standard colors used for application windows, buttons and other features. These colors are grouped into three color groups: active, inactive, and disabled. See the QPalette documentation for details about color groups and the properties provided by SystemPalette.

This can be used to color items in a way that provides a more native look and feel.

The following example creates a palette from the Active color group and uses this to color the window and text items appropriately:

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

See also QPalette.

Property Documentation

[read-only] alternateBase : color

The alternate base color of the current color group.

See also QPalette::ColorRole.


[read-only] base : color

The base color of the current color group.

See also QPalette::ColorRole.


[read-only] button : color

The button color of the current color group.

See also QPalette::ColorRole.


[read-only] buttonText : color

The button text foreground color of the current color group.

See also QPalette::ColorRole.


colorGroup : enumeration

The color group of the palette. This can be one of:

ConstantDescription
SystemPalette.Active(default) QPalette::Active
SystemPalette.InactiveQPalette::Inactive
SystemPalette.DisabledQPalette::Disabled

See also QPalette::ColorGroup.


[read-only] dark : color

The dark color of the current color group.

See also QPalette::ColorRole.


[read-only] highlight : color

The highlight color of the current color group.

See also QPalette::ColorRole.


[read-only] highlightedText : color

The highlighted text color of the current color group.

See also QPalette::ColorRole.


[read-only] light : color

The light color of the current color group.

See also QPalette::ColorRole.


[read-only] mid : color

The mid color of the current color group.

See also QPalette::ColorRole.


[read-only] midlight : color

The midlight color of the current color group.

See also QPalette::ColorRole.


[read-only, since 6.2] placeholderText : color

The placeholder text color of the current color group.

This property was introduced in Qt 6.2.

See also QPalette::ColorRole.


[read-only] shadow : color

The shadow color of the current color group.

See also QPalette::ColorRole.


[read-only] text : color

The text color of the current color group.

See also QPalette::ColorRole.


[read-only] window : color

The window (general background) color of the current color group.

See also QPalette::ColorRole.


[read-only] windowText : color

The window text (general foreground) color of the current color group.

See also QPalette::ColorRole.


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