5#include <QtQuick/private/qquickabstractpaletteprovider_p.h>
6#include <QtGui/private/qpalette_p.h>
12 return p1.resolveMask() !=
p2.resolveMask() ||
p1 !=
p2;
26static std::default_delete<const QQuickAbstractPaletteProvider>
defaultDeleter() {
return {}; }
40 ensureRequestedPalette();
43 return updateInheritedPalette();
65 return updateInheritedPalette();
91 unsetResolveMask = getResolveMask(
group);
96 return updateInheritedPalette();
101 m_requestedPalette.
value() = std::move(
p);
102 return updateInheritedPalette();
107 return m_resolvedPalette;
113 return m_paletteProvider.get();
118 static const auto emptyDeleter = [](
auto &&){};
125 ensureRequestedPalette();
127 auto srcPalette =
p.palette();
130 if (srcPalette.isBrushSet(cg, cr)) {
131 m_requestedPalette->
setBrush(cg, cr, srcPalette.brush(cg, cr));
135 return updateInheritedPalette();
153 return doInheritPalette(
palette);
161bool QQuickPaletteColorProvider::doInheritPalette(
const QPalette &
palette)
169 tmpResolvedPalette.
setResolveMask(tmpResolvedPalette.resolveMask() | inheritedMask);
171 bool changed =
notEq(tmpResolvedPalette, m_resolvedPalette);
173 std::swap(tmpResolvedPalette, m_resolvedPalette);
182bool QQuickPaletteColorProvider::updateInheritedPalette()
190void QQuickPaletteColorProvider::ensureRequestedPalette()
QPalette defaultPalette() const override
The QColor class provides colors based on RGB, HSV or CMYK values.
static constexpr QPalette::ResolveMask bitPosition(QPalette::ColorGroup colorGroup, QPalette::ColorRole colorRole)
The QPalette class contains color groups for each widget state.
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
void setBrush(ColorRole cr, const QBrush &brush)
Sets the brush for the given color role to the specified brush for all groups in the palette.
void setResolveMask(ResolveMask mask)
ResolveMask resolveMask() const
ColorGroup
\value Disabled \value Active \value Inactive \value Normal synonym for Active
QPalette resolve(const QPalette &other) const
Returns a new QPalette that is a union of this instance and other.
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
ColorGroup currentColorGroup() const
Returns the palette's current color group.
virtual QPalette defaultPalette() const =0
const QQuickAbstractPaletteProvider * paletteProvider() const
bool copyColorGroup(QPalette::ColorGroup cg, const QQuickPaletteColorProvider &p)
void setPaletteProvider(const QQuickAbstractPaletteProvider *paletteProvider)
bool fromQPalette(QPalette p)
bool resetColor(QPalette::ColorGroup group, QPalette::ColorRole role)
bool inheritPalette(const QPalette &palette)
QQuickPaletteColorProvider()
bool setColor(QPalette::ColorGroup group, QPalette::ColorRole role, QColor color)
const QColor & color(QPalette::ColorGroup group, QPalette::ColorRole role) const
Combined button and popup list for selecting options.
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
static std::default_delete< const QQuickAbstractPaletteProvider > defaultDeleter()
static QPalette::ColorGroup adjustCg(QPalette::ColorGroup group)
static QT_BEGIN_NAMESPACE bool notEq(const QPalette &p1, const QPalette &p2)