ColorGroup QML Type

The set of colors by roles. 更多...

import 語句: import QtQuick
繼承:

QtObject

繼承者:

Palette

特性

信號

詳細描述

The ColorGroup type is used to define a set of colors with certain roles. Although a ColorGroup has no visual appearance, it defines colors used to customize rendered items.

Default values of colors are equal to active group colors of default-constructed QPalette .

The following code can be used to create a color group with some colors specified:

ColorGroup {
    alternateBase: "red"
    base: "green"
}
					

The Palette type exposes color groups for each QML item state.

特性文檔編製

accent : color [since 6.6]

A color that typically contrasts or compliments base , window ,和 button colors. It usually represents the users' choice of desktop personalisation. Styling of interactive components is a typical use case. Unless explicitly set, it defaults to highlight .

該特性在 Qt 6.6 引入。

alternateBase : color

Used as the alternate background color in item views with alternating row colors.

base : color

Used mostly as the background color for text editor controls and item views. It is usually white or another light color.

brightText : color

文本顔色很不同於 windowText ,且有鮮明對比與 dark 。通常用於需要繪製的文本,其中 text , windowText or buttonText would give poor contrast, such as on highlighted buttons.

button : color

一般按鈕的背景色。此背景可以不同於 window 因為有些樣式要求不同背景色對於按鈕。

buttonText : color

前景顔色使用 palette 顔色。

dark : color

前景顔色使用 palette 顔色。

highlight : color

A color to indicate a selected item or the current item.

highlightedText : color

文本顔色形成對比與 highlight .

light : color

更亮比 button .

A text color used for hyperlinks.

linkVisited : color

A text color used for already visited hyperlinks.

mid : color

介於 palette.button and dark .

midlight : color

介於 button and light .

placeholderText : color [since 6.2]

Used as the place holder color for editable single line fields.

該特性在 Qt 6.2 引入。

shadow : color

A very dark color.

text : color

前景顔色使用 base 。這通常如同 windowText ,在這種情況下,它必須提供很好的對比與 window and base .

toolTipBase : color

Used as the background color for tooltips.

toolTipText : color

Used as the foreground color for tooltips.

window : color

一般背景色。

windowText : color

一般前景色。

信號文檔編製

changed ()

Additional signal indicates that the current state of this color group has been changed. Usually it means that one of the colors is changed.

注意: 相應處理程序是 onChanged .