QQuickPalette Class

Contains color groups for each QML item state. \inmodule QtQuick \since 6.0. More...

Header: #include <QQuickPalette>
Instantiated By: Palette
Inherits: QQuickColorGroup

Public Functions

QQuickColorGroup *active() const
QQuickColorGroup *disabled() const
QQuickColorGroup *inactive() const
void setCurrentGroup(QPalette::ColorGroup currentGroup)

Reimplemented Public Functions

virtual QPalette::ColorGroup currentColorGroup() const override

Public Slots

void setActive(QQuickColorGroup *active)
void setDisabled(QQuickColorGroup *disabled)
void setInactive(QQuickColorGroup *inactive)

Signals

Detailed Description

\internal

This class is the wrapper around QPalette.

See also QQuickColorGroup, QQuickAbstractPaletteProvider, and QPalette.

Member Function Documentation

[override virtual] QPalette::ColorGroup QQuickPalette::currentColorGroup() const

\internal

Returns the palette's current color group. The default value is Active.

void QQuickPalette::setCurrentGroup(QPalette::ColorGroup currentGroup)

\internal

Sets currentGroup for this palette.

The current color group is used when accessing colors of this palette. For example, if color group is Disabled, color accessors will be returning colors form the respective group.

 QQuickPalette palette;

 palette.setAlternateBase(Qt::green);
 palette.disabled()->setAlternateBase(Qt::red);

 auto color = palette.alternateBase(); // Qt::green

 palette.setCurrentGroup(QPalette::Disabled);
 color = palette.alternateBase(); // Qt::red

Emits QColorGroup::changed().