SystemPalette QML Type

Provides access to the Qt palettes. 更多...

import 語句: import QtQuick

特性

詳細描述

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 ,和 disabled 。見 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
    }
}
					

另請參閱 QPalette .

特性文檔編製

accent : color [read-only, since 6.7]

The accent color of the current color group.

該特性在 Qt 6.7 引入。

另請參閱 QPalette::ColorRole .

alternateBase : color [read-only]

The alternate base color of the current color group.

另請參閱 QPalette::ColorRole .

base : color [read-only]

The base color of the current color group.

另請參閱 QPalette::ColorRole .

button : color [read-only]

The button color of the current color group.

另請參閱 QPalette::ColorRole .

buttonText : color [read-only]

The button text foreground color of the current color group.

另請參閱 QPalette::ColorRole .

colorGroup : enumeration

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

常量 描述
SystemPalette.Active (默認) QPalette::Active
SystemPalette.Inactive QPalette::Inactive
SystemPalette.Disabled QPalette::Disabled

另請參閱 QPalette::ColorGroup .

dark : color [read-only]

The dark color of the current color group.

另請參閱 QPalette::ColorRole .

highlight : color [read-only]

The highlight color of the current color group.

另請參閱 QPalette::ColorRole .

highlightedText : color [read-only]

The highlighted text color of the current color group.

另請參閱 QPalette::ColorRole .

light : color [read-only]

The light color of the current color group.

另請參閱 QPalette::ColorRole .

mid : color [read-only]

The mid color of the current color group.

另請參閱 QPalette::ColorRole .

midlight : color [read-only]

The midlight color of the current color group.

另請參閱 QPalette::ColorRole .

placeholderText : color [read-only, since 6.2]

The placeholder text color of the current color group.

該特性在 Qt 6.2 引入。

另請參閱 QPalette::ColorRole .

shadow : color [read-only]

The shadow color of the current color group.

另請參閱 QPalette::ColorRole .

text : color [read-only]

The text color of the current color group.

另請參閱 QPalette::ColorRole .

window : color [read-only]

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

另請參閱 QPalette::ColorRole .

windowText : color [read-only]

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

另請參閱 QPalette::ColorRole .