5#include <QtQuick/private/qquickabstractpaletteprovider_p.h>
11 return p1.resolveMask() !=
p2.resolveMask() ||
p1 !=
p2;
41 "The resolve mask type is not wide enough to fit the entire bit mask.");
50static std::default_delete<const QQuickAbstractPaletteProvider>
defaultDeleter() {
return {}; }
64 ensureRequestedPalette();
67 return updateInheritedPalette();
89 return updateInheritedPalette();
115 unsetResolveMask = getResolveMask(
group);
120 return updateInheritedPalette();
125 m_requestedPalette.
value() = std::move(
p);
126 return updateInheritedPalette();
131 return m_resolvedPalette;
137 return m_paletteProvider.get();
142 static const auto emptyDeleter = [](
auto &&){};
149 ensureRequestedPalette();
151 auto srcPalette =
p.palette();
154 if (srcPalette.isBrushSet(cg, cr)) {
155 m_requestedPalette->
setBrush(cg, cr, srcPalette.brush(cg, cr));
159 return updateInheritedPalette();
177 return doInheritPalette(
palette);
185bool QQuickPaletteColorProvider::doInheritPalette(
const QPalette &
palette)
193 tmpResolvedPalette.
setResolveMask(tmpResolvedPalette.resolveMask() | inheritedMask);
195 bool changed =
notEq(tmpResolvedPalette, m_resolvedPalette);
197 std::swap(tmpResolvedPalette, m_resolvedPalette);
206bool QQuickPaletteColorProvider::updateInheritedPalette()
214void QQuickPaletteColorProvider::ensureRequestedPalette()
QPalette defaultPalette() const override
The QColor class provides colors based on RGB, HSV or CMYK values.
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 constexpr QPalette::ResolveMask bitPosition(QPalette::ColorGroup colorGroup, QPalette::ColorRole colorRole)
static constexpr QPalette::ResolveMask bitPosition(QPalette::ColorGroup colorGroup, QPalette::ColorRole colorRole)
static std::default_delete< const QQuickAbstractPaletteProvider > defaultDeleter()
static constexpr QPalette::ResolveMask colorRoleOffset(QPalette::ColorGroup colorGroup)
static QPalette::ColorGroup adjustCg(QPalette::ColorGroup group)
static QT_BEGIN_NAMESPACE bool notEq(const QPalette &p1, const QPalette &p2)
constexpr std::underlying_type_t< Enum > qToUnderlying(Enum e) noexcept