- Qt 6.10
- Qt Quick
- QML Types
- ColorGroup
- Qt 6.10.2 Reference Documentation

# ColorGroup QML Type

The set of colors by roles. More...

Import Statement: | `import QtQuick`
Inherits: | QtObject
Inherited By: | Palette

- List of all members, including inherited members

## Properties

- accent : color `(since 6.6)`
- alternateBase : color
- base : color
- brightText : color
- button : color
- buttonText : color
- dark : color
- highlight : color
- highlightedText : color
- light : color
- link : color
- linkVisited : color
- mid : color
- midlight : color
- placeholderText : color `(since 6.2)`
- shadow : color
- text : color
- toolTipBase : color
- toolTipText : color
- window : color
- windowText : color

## Signals

- changed()

## Detailed Description

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.

## Property Documentation

accent : color `[since 6.6]`

A color that typically contrasts or compliments base, window, and 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.

This property was introduced in 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

A text color that is very different from `windowText`, and contrasts well with e.g. `dark`. Typically used for text that needs to be drawn where `text`, `windowText` or `buttonText` would give poor contrast, such as on highlighted buttons.

button : color

The general button background color. This background can be different from `window` as some styles require a different background color for buttons.

buttonText : color

A foreground color used with the `palette` color.

dark : color

A foreground color used with the `palette` color.

highlight : color

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

highlightedText : color

A text color that contrasts with `highlight`.

light : color

Lighter than `button`.

link : color

A text color used for hyperlinks.

linkVisited : color

A text color used for already visited hyperlinks.

mid : color

Between `palette.button` and `dark`.

midlight : color

Between `button` and `light`.

placeholderText : color `[since 6.2]`

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

This property was introduced in Qt 6.2.

shadow : color

A very dark color.

text : color

The foreground color used with `base`. This is usually the same as the `windowText`, in which case it must provide good contrast with `window` and `base`.

toolTipBase : color

Used as the background color for tooltips.

toolTipText : color

Used as the foreground color for tooltips.

window : color

A general background color.

windowText : color

A general foreground color.

## Signal Documentation

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.

Note: The corresponding handler is `onChanged`.