Rename confusingly named QFont/QPalette::resolve overloads
Having three methods with the same name doing different things is unnecessarily confusing, so follow the standard naming convention in Qt and call the getter of the resolve mask resolveMask, and the setter setResolveMask. These methods were all documented as internal. The publicly documented resolve() method that merges two fonts and palettes based on the respective masks remains as it is, even though 'merge' would perhaps be a better name. Change-Id: If90b1ad800834baccd1dbc38fc6b861540d6df6e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
c0d0949448
commit
b77a3f47c9
@ -3368,10 +3368,10 @@ bool QGuiApplicationPrivate::setPalette(const QPalette &palette)
|
||||
// Resolve the palette against the theme palette, filling in
|
||||
// any missing roles, while keeping the original resolve mask.
|
||||
QPalette basePalette = qGuiApp ? qGuiApp->d_func()->basePalette() : Qt::gray;
|
||||
basePalette.resolve(0); // The base palette only contributes missing colors roles
|
||||
basePalette.setResolveMask(0); // The base palette only contributes missing colors roles
|
||||
QPalette resolvedPalette = palette.resolve(basePalette);
|
||||
|
||||
if (app_pal && resolvedPalette == *app_pal && resolvedPalette.resolve() == app_pal->resolve())
|
||||
if (app_pal && resolvedPalette == *app_pal && resolvedPalette.resolveMask() == app_pal->resolveMask())
|
||||
return false;
|
||||
|
||||
if (!app_pal)
|
||||
@ -3379,7 +3379,7 @@ bool QGuiApplicationPrivate::setPalette(const QPalette &palette)
|
||||
else
|
||||
*app_pal = resolvedPalette;
|
||||
|
||||
QCoreApplication::setAttribute(Qt::AA_SetPalette, app_pal->resolve() != 0);
|
||||
QCoreApplication::setAttribute(Qt::AA_SetPalette, app_pal->resolveMask() != 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -961,20 +961,22 @@ QPalette QPalette::resolve(const QPalette &other) const
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn uint QPalette::resolve() const
|
||||
\fn QPalette::ResolveMask QPalette::resolveMask() const
|
||||
\internal
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef ResolveMaskType
|
||||
\internal
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QPalette::resolve(ResolveMaskType mask)
|
||||
\typedef ResolveMask
|
||||
\internal
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QPalette::setResolveMask(ResolveMask)
|
||||
\internal
|
||||
|
||||
A bit mask that stores which colors the palette instance explicitly defines,
|
||||
and which ones are inherited from a parent.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
QPalette stream functions
|
||||
@ -1250,7 +1252,7 @@ QDebug operator<<(QDebug dbg, const QPalette &p)
|
||||
QDebugStateSaver saver(dbg);
|
||||
dbg.nospace();
|
||||
|
||||
dbg << "QPalette(resolve=" << Qt::hex << Qt::showbase << p.resolve();
|
||||
dbg << "QPalette(resolve=" << Qt::hex << Qt::showbase << p.resolveMask();
|
||||
|
||||
auto roleString = rolesToString(p);
|
||||
if (!roleString.isEmpty())
|
||||
|
@ -157,8 +157,8 @@ public:
|
||||
QPalette resolve(const QPalette &other) const;
|
||||
|
||||
using ResolveMask = quint64;
|
||||
inline ResolveMask resolve() const { return data.resolveMask; }
|
||||
inline void resolve(ResolveMask mask) { data.resolveMask = mask; }
|
||||
inline ResolveMask resolveMask() const { return data.resolveMask; }
|
||||
inline void setResolveMask(ResolveMask mask) { data.resolveMask = mask; }
|
||||
|
||||
private:
|
||||
void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
|
||||
|
@ -1761,12 +1761,12 @@ QFont QFont::resolve(const QFont &other) const
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn uint QFont::resolve() const
|
||||
\fn uint QFont::resolveMask() const
|
||||
\internal
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QFont::resolve(uint mask)
|
||||
\fn void QFont::setResolveMask(uint mask)
|
||||
\internal
|
||||
*/
|
||||
|
||||
|
@ -275,8 +275,8 @@ public:
|
||||
QString defaultFamily() const;
|
||||
|
||||
QFont resolve(const QFont &) const;
|
||||
inline uint resolve() const { return resolve_mask; }
|
||||
inline void resolve(uint mask) { resolve_mask = mask; }
|
||||
inline uint resolveMask() const { return resolve_mask; }
|
||||
inline void setResolveMask(uint mask) { resolve_mask = mask; }
|
||||
|
||||
private:
|
||||
explicit QFont(QFontPrivate *);
|
||||
|
@ -324,7 +324,7 @@ size_t QTextFormatPrivate::recalcHash() const
|
||||
void QTextFormatPrivate::resolveFont(const QFont &defaultFont)
|
||||
{
|
||||
recalcFont();
|
||||
const uint oldMask = fnt.resolve();
|
||||
const uint oldMask = fnt.resolveMask();
|
||||
fnt = fnt.resolve(defaultFont);
|
||||
|
||||
if (hasProperty(QTextFormat::FontSizeAdjustment)) {
|
||||
@ -342,7 +342,7 @@ void QTextFormatPrivate::resolveFont(const QFont &defaultFont)
|
||||
}
|
||||
}
|
||||
|
||||
fnt.resolve(oldMask);
|
||||
fnt.setResolveMask(oldMask);
|
||||
}
|
||||
|
||||
void QTextFormatPrivate::recalcFont() const
|
||||
@ -1971,7 +1971,7 @@ QStringList QTextCharFormat::anchorNames() const
|
||||
void QTextCharFormat::setFont(const QFont &font, FontPropertiesInheritanceBehavior behavior)
|
||||
{
|
||||
const uint mask = behavior == FontPropertiesAll ? uint(QFont::AllPropertiesResolved)
|
||||
: font.resolve();
|
||||
: font.resolveMask();
|
||||
|
||||
if (mask & QFont::FamilyResolved)
|
||||
setFontFamily(font.family());
|
||||
|
@ -93,7 +93,7 @@ void QCocoaMenu::setMinimumWidth(int width)
|
||||
|
||||
void QCocoaMenu::setFont(const QFont &font)
|
||||
{
|
||||
if (font.resolve()) {
|
||||
if (font.resolveMask()) {
|
||||
NSFont *customMenuFont = [NSFont fontWithName:font.family().toNSString()
|
||||
size:font.pointSize()];
|
||||
m_nativeMenu.font = customMenuFont;
|
||||
|
@ -370,14 +370,14 @@ bool QWindowsXPStylePrivate::isItemViewDelegateLineEdit(const QWidget *widget)
|
||||
// Returns whether base color is set for this widget
|
||||
bool QWindowsXPStylePrivate::isLineEditBaseColorSet(const QStyleOption *option, const QWidget *widget)
|
||||
{
|
||||
uint resolveMask = option->palette.resolve();
|
||||
uint resolveMask = option->palette.resolveMask();
|
||||
if (widget) {
|
||||
// Since spin box includes a line edit we need to resolve the palette mask also from
|
||||
// the parent, as while the color is always correct on the palette supplied by panel,
|
||||
// the mask can still be empty. If either mask specifies custom base color, use that.
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (const QAbstractSpinBox *spinbox = qobject_cast<QAbstractSpinBox*>(widget->parentWidget()))
|
||||
resolveMask |= spinbox->palette().resolve();
|
||||
resolveMask |= spinbox->palette().resolveMask();
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
}
|
||||
return (resolveMask & (1 << QPalette::Base)) != 0;
|
||||
|
@ -843,7 +843,7 @@ bool QGraphicsProxyWidget::event(QEvent *event)
|
||||
case QEvent::FontChange: {
|
||||
// Propagate to widget.
|
||||
QWidgetPrivate *wd = d->widget->d_func();
|
||||
int mask = d->font.resolve() | d->inheritedFontResolveMask;
|
||||
int mask = d->font.resolveMask() | d->inheritedFontResolveMask;
|
||||
wd->inheritedFontResolveMask = mask;
|
||||
wd->resolveFont();
|
||||
break;
|
||||
@ -851,7 +851,7 @@ bool QGraphicsProxyWidget::event(QEvent *event)
|
||||
case QEvent::PaletteChange: {
|
||||
// Propagate to widget.
|
||||
QWidgetPrivate *wd = d->widget->d_func();
|
||||
int mask = d->palette.resolve() | d->inheritedPaletteResolveMask;
|
||||
int mask = d->palette.resolveMask() | d->inheritedPaletteResolveMask;
|
||||
wd->inheritedPaletteResolveMask = mask;
|
||||
wd->resolvePalette();
|
||||
break;
|
||||
|
@ -1532,7 +1532,7 @@ void QGraphicsScenePrivate::ensureSequentialTopLevelSiblingIndexes()
|
||||
*/
|
||||
void QGraphicsScenePrivate::setFont_helper(const QFont &font)
|
||||
{
|
||||
if (this->font == font && this->font.resolve() == font.resolve())
|
||||
if (this->font == font && this->font.resolveMask() == font.resolveMask())
|
||||
return;
|
||||
updateFont(font);
|
||||
}
|
||||
@ -1546,7 +1546,7 @@ void QGraphicsScenePrivate::setFont_helper(const QFont &font)
|
||||
void QGraphicsScenePrivate::resolveFont()
|
||||
{
|
||||
QFont naturalFont = QApplication::font();
|
||||
naturalFont.resolve(0);
|
||||
naturalFont.setResolveMask(0);
|
||||
QFont resolvedFont = font.resolve(naturalFont);
|
||||
updateFont(resolvedFont);
|
||||
}
|
||||
@ -1572,7 +1572,7 @@ void QGraphicsScenePrivate::updateFont(const QFont &font)
|
||||
// Resolvefont for an item is a noop operation, but
|
||||
// every item can be a widget, or can have a widget
|
||||
// childre.
|
||||
item->d_ptr->resolveFont(font.resolve());
|
||||
item->d_ptr->resolveFont(font.resolveMask());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1589,7 +1589,7 @@ void QGraphicsScenePrivate::updateFont(const QFont &font)
|
||||
*/
|
||||
void QGraphicsScenePrivate::setPalette_helper(const QPalette &palette)
|
||||
{
|
||||
if (this->palette == palette && this->palette.resolve() == palette.resolve())
|
||||
if (this->palette == palette && this->palette.resolveMask() == palette.resolveMask())
|
||||
return;
|
||||
updatePalette(palette);
|
||||
}
|
||||
@ -1603,7 +1603,7 @@ void QGraphicsScenePrivate::setPalette_helper(const QPalette &palette)
|
||||
void QGraphicsScenePrivate::resolvePalette()
|
||||
{
|
||||
QPalette naturalPalette = QGuiApplication::palette();
|
||||
naturalPalette.resolve(0);
|
||||
naturalPalette.setResolveMask(0);
|
||||
QPalette resolvedPalette = palette.resolve(naturalPalette);
|
||||
updatePalette(resolvedPalette);
|
||||
}
|
||||
@ -1629,7 +1629,7 @@ void QGraphicsScenePrivate::updatePalette(const QPalette &palette)
|
||||
// ResolvePalette for an item is a noop operation, but
|
||||
// every item can be a widget, or can have a widget
|
||||
// children.
|
||||
item->d_ptr->resolvePalette(palette.resolve());
|
||||
item->d_ptr->resolvePalette(palette.resolveMask());
|
||||
}
|
||||
}
|
||||
|
||||
@ -2548,8 +2548,8 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
|
||||
addItem(child);
|
||||
|
||||
// Resolve font and palette.
|
||||
item->d_ptr->resolveFont(d->font.resolve());
|
||||
item->d_ptr->resolvePalette(d->palette.resolve());
|
||||
item->d_ptr->resolveFont(d->font.resolveMask());
|
||||
item->d_ptr->resolvePalette(d->palette.resolveMask());
|
||||
|
||||
|
||||
// Reenable selectionChanged() for individual items
|
||||
@ -5562,7 +5562,7 @@ void QGraphicsScene::setFont(const QFont &font)
|
||||
{
|
||||
Q_D(QGraphicsScene);
|
||||
QFont naturalFont = QApplication::font();
|
||||
naturalFont.resolve(0);
|
||||
naturalFont.setResolveMask(0);
|
||||
QFont resolvedFont = font.resolve(naturalFont);
|
||||
d->setFont_helper(resolvedFont);
|
||||
}
|
||||
@ -5599,7 +5599,7 @@ void QGraphicsScene::setPalette(const QPalette &palette)
|
||||
{
|
||||
Q_D(QGraphicsScene);
|
||||
QPalette naturalPalette = QGuiApplication::palette();
|
||||
naturalPalette.resolve(0);
|
||||
naturalPalette.setResolveMask(0);
|
||||
QPalette resolvedPalette = palette.resolve(naturalPalette);
|
||||
d->setPalette_helper(resolvedPalette);
|
||||
}
|
||||
|
@ -977,13 +977,13 @@ QFont QGraphicsWidget::font() const
|
||||
{
|
||||
Q_D(const QGraphicsWidget);
|
||||
QFont fnt = d->font;
|
||||
fnt.resolve(fnt.resolve() | d->inheritedFontResolveMask);
|
||||
fnt.setResolveMask(fnt.resolveMask() | d->inheritedFontResolveMask);
|
||||
return fnt;
|
||||
}
|
||||
void QGraphicsWidget::setFont(const QFont &font)
|
||||
{
|
||||
Q_D(QGraphicsWidget);
|
||||
setAttribute(Qt::WA_SetFont, font.resolve() != 0);
|
||||
setAttribute(Qt::WA_SetFont, font.resolveMask() != 0);
|
||||
|
||||
QFont naturalFont = d->naturalWidgetFont();
|
||||
QFont resolvedFont = font.resolve(naturalFont);
|
||||
@ -1023,7 +1023,7 @@ QPalette QGraphicsWidget::palette() const
|
||||
void QGraphicsWidget::setPalette(const QPalette &palette)
|
||||
{
|
||||
Q_D(QGraphicsWidget);
|
||||
setAttribute(Qt::WA_SetPalette, palette.resolve() != 0);
|
||||
setAttribute(Qt::WA_SetPalette, palette.resolveMask() != 0);
|
||||
|
||||
QPalette naturalPalette = d->naturalWidgetPalette();
|
||||
QPalette resolvedPalette = palette.resolve(naturalPalette);
|
||||
|
@ -150,7 +150,7 @@ void QGraphicsWidgetPrivate::ensureWindowData()
|
||||
|
||||
void QGraphicsWidgetPrivate::setPalette_helper(const QPalette &palette)
|
||||
{
|
||||
if (this->palette == palette && this->palette.resolve() == palette.resolve())
|
||||
if (this->palette == palette && this->palette.resolveMask() == palette.resolveMask())
|
||||
return;
|
||||
updatePalette(palette);
|
||||
}
|
||||
@ -172,7 +172,7 @@ void QGraphicsWidgetPrivate::updatePalette(const QPalette &palette)
|
||||
// Calculate new mask.
|
||||
if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation))
|
||||
inheritedPaletteResolveMask = 0;
|
||||
int mask = palette.resolve() | inheritedPaletteResolveMask;
|
||||
int mask = palette.resolveMask() | inheritedPaletteResolveMask;
|
||||
|
||||
// Propagate to children.
|
||||
for (int i = 0; i < children.size(); ++i) {
|
||||
@ -239,13 +239,13 @@ QPalette QGraphicsWidgetPrivate::naturalWidgetPalette() const
|
||||
} else if (scene) {
|
||||
palette = scene->palette();
|
||||
}
|
||||
palette.resolve(0);
|
||||
palette.setResolveMask(0);
|
||||
return palette;
|
||||
}
|
||||
|
||||
void QGraphicsWidgetPrivate::setFont_helper(const QFont &font)
|
||||
{
|
||||
if (this->font == font && this->font.resolve() == font.resolve())
|
||||
if (this->font == font && this->font.resolveMask() == font.resolveMask())
|
||||
return;
|
||||
updateFont(font);
|
||||
}
|
||||
@ -270,7 +270,7 @@ void QGraphicsWidgetPrivate::updateFont(const QFont &font)
|
||||
// Calculate new mask.
|
||||
if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation))
|
||||
inheritedFontResolveMask = 0;
|
||||
int mask = font.resolve() | inheritedFontResolveMask;
|
||||
int mask = font.resolveMask() | inheritedFontResolveMask;
|
||||
|
||||
// Propagate to children.
|
||||
for (int i = 0; i < children.size(); ++i) {
|
||||
@ -300,7 +300,7 @@ QFont QGraphicsWidgetPrivate::naturalWidgetFont() const
|
||||
} else if (scene) {
|
||||
naturalFont = scene->font();
|
||||
}
|
||||
naturalFont.resolve(0);
|
||||
naturalFont.setResolveMask(0);
|
||||
return naturalFont;
|
||||
}
|
||||
|
||||
|
@ -1185,9 +1185,9 @@ void QApplication::setPalette(const QPalette &palette, const char* className)
|
||||
if (className) {
|
||||
QPalette polishedPalette = palette;
|
||||
if (QApplicationPrivate::app_style) {
|
||||
auto originalResolveMask = palette.resolve();
|
||||
auto originalResolveMask = palette.resolveMask();
|
||||
QApplicationPrivate::app_style->polish(polishedPalette);
|
||||
polishedPalette.resolve(originalResolveMask);
|
||||
polishedPalette.setResolveMask(originalResolveMask);
|
||||
}
|
||||
|
||||
QApplicationPrivate::widgetPalettes.insert(className, polishedPalette);
|
||||
|
@ -1831,14 +1831,14 @@ void QWidgetPrivate::propagatePaletteChange()
|
||||
#if QT_CONFIG(graphicsview)
|
||||
if (!q->parentWidget() && extra && extra->proxyWidget) {
|
||||
QGraphicsProxyWidget *p = extra->proxyWidget;
|
||||
inheritedPaletteResolveMask = p->d_func()->inheritedPaletteResolveMask | p->palette().resolve();
|
||||
inheritedPaletteResolveMask = p->d_func()->inheritedPaletteResolveMask | p->palette().resolveMask();
|
||||
} else
|
||||
#endif // QT_CONFIG(graphicsview)
|
||||
if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) {
|
||||
inheritedPaletteResolveMask = 0;
|
||||
}
|
||||
|
||||
directPaletteResolveMask = data.pal.resolve();
|
||||
directPaletteResolveMask = data.pal.resolveMask();
|
||||
auto mask = directPaletteResolveMask | inheritedPaletteResolveMask;
|
||||
|
||||
const bool useStyleSheetPropagationInWidgetStyles =
|
||||
@ -4376,7 +4376,7 @@ const QPalette &QWidget::palette() const
|
||||
void QWidget::setPalette(const QPalette &palette)
|
||||
{
|
||||
Q_D(QWidget);
|
||||
setAttribute(Qt::WA_SetPalette, palette.resolve() != 0);
|
||||
setAttribute(Qt::WA_SetPalette, palette.resolveMask() != 0);
|
||||
|
||||
// Determine which palette is inherited from this widget's ancestors and
|
||||
// QApplication::palette, resolve this against \a palette (attributes from
|
||||
@ -4414,7 +4414,7 @@ QPalette QWidgetPrivate::naturalWidgetPalette(QPalette::ResolveMask inheritedMas
|
||||
if (!p->testAttribute(Qt::WA_StyleSheet) || useStyleSheetPropagationInWidgetStyles) {
|
||||
if (!naturalPalette.isCopyOf(QGuiApplication::palette())) {
|
||||
QPalette inheritedPalette = p->palette();
|
||||
inheritedPalette.resolve(inheritedMask);
|
||||
inheritedPalette.setResolveMask(inheritedMask);
|
||||
naturalPalette = inheritedPalette.resolve(naturalPalette);
|
||||
} else {
|
||||
naturalPalette = p->palette();
|
||||
@ -4424,12 +4424,12 @@ QPalette QWidgetPrivate::naturalWidgetPalette(QPalette::ResolveMask inheritedMas
|
||||
#if QT_CONFIG(graphicsview)
|
||||
else if (extra && extra->proxyWidget) {
|
||||
QPalette inheritedPalette = extra->proxyWidget->palette();
|
||||
inheritedPalette.resolve(inheritedMask);
|
||||
inheritedPalette.setResolveMask(inheritedMask);
|
||||
naturalPalette = inheritedPalette.resolve(naturalPalette);
|
||||
}
|
||||
#endif // QT_CONFIG(graphicsview)
|
||||
}
|
||||
naturalPalette.resolve(0);
|
||||
naturalPalette.setResolveMask(0);
|
||||
return naturalPalette;
|
||||
}
|
||||
/*!
|
||||
@ -4450,7 +4450,7 @@ void QWidgetPrivate::resolvePalette()
|
||||
void QWidgetPrivate::setPalette_helper(const QPalette &palette)
|
||||
{
|
||||
Q_Q(QWidget);
|
||||
if (data.pal == palette && data.pal.resolve() == palette.resolve())
|
||||
if (data.pal == palette && data.pal.resolveMask() == palette.resolveMask())
|
||||
return;
|
||||
data.pal = palette;
|
||||
updateSystemBackground();
|
||||
@ -4520,7 +4520,7 @@ void QWidget::setFont(const QFont &font)
|
||||
style->saveWidgetFont(this, font);
|
||||
#endif
|
||||
|
||||
setAttribute(Qt::WA_SetFont, font.resolve() != 0);
|
||||
setAttribute(Qt::WA_SetFont, font.resolveMask() != 0);
|
||||
|
||||
// Determine which font is inherited from this widget's ancestors and
|
||||
// QApplication::font, resolve this against \a font (attributes from the
|
||||
@ -4562,7 +4562,7 @@ QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const
|
||||
if (!naturalFont.isCopyOf(QApplication::font())) {
|
||||
if (inheritedMask != 0) {
|
||||
QFont inheritedFont = p->font();
|
||||
inheritedFont.resolve(inheritedMask);
|
||||
inheritedFont.setResolveMask(inheritedMask);
|
||||
naturalFont = inheritedFont.resolve(naturalFont);
|
||||
} // else nothing to do (naturalFont = naturalFont)
|
||||
} else {
|
||||
@ -4574,13 +4574,13 @@ QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const
|
||||
else if (extra && extra->proxyWidget) {
|
||||
if (inheritedMask != 0) {
|
||||
QFont inheritedFont = extra->proxyWidget->font();
|
||||
inheritedFont.resolve(inheritedMask);
|
||||
inheritedFont.setResolveMask(inheritedMask);
|
||||
naturalFont = inheritedFont.resolve(naturalFont);
|
||||
} // else nothing to do (naturalFont = naturalFont)
|
||||
}
|
||||
#endif // QT_CONFIG(graphicsview)
|
||||
}
|
||||
naturalFont.resolve(0);
|
||||
naturalFont.setResolveMask(0);
|
||||
return naturalFont;
|
||||
}
|
||||
|
||||
@ -4592,7 +4592,7 @@ QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const
|
||||
QFont QWidgetPrivate::localFont() const
|
||||
{
|
||||
QFont localfont = data.fnt;
|
||||
localfont.resolve(directFontResolveMask);
|
||||
localfont.setResolveMask(directFontResolveMask);
|
||||
return localfont;
|
||||
}
|
||||
|
||||
@ -4636,18 +4636,18 @@ void QWidgetPrivate::updateFont(const QFont &font)
|
||||
#if QT_CONFIG(graphicsview)
|
||||
if (!q->parentWidget() && extra && extra->proxyWidget) {
|
||||
QGraphicsProxyWidget *p = extra->proxyWidget;
|
||||
inheritedFontResolveMask = p->d_func()->inheritedFontResolveMask | p->font().resolve();
|
||||
inheritedFontResolveMask = p->d_func()->inheritedFontResolveMask | p->font().resolveMask();
|
||||
} else
|
||||
#endif // QT_CONFIG(graphicsview)
|
||||
if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) {
|
||||
inheritedFontResolveMask = 0;
|
||||
}
|
||||
uint newMask = data.fnt.resolve() | inheritedFontResolveMask;
|
||||
uint newMask = data.fnt.resolveMask() | inheritedFontResolveMask;
|
||||
// Set the font as also having resolved inherited traits, so the result of reading QWidget::font()
|
||||
// isn't all weak information, but save the original mask to be able to let new changes on the
|
||||
// parent widget font propagate correctly.
|
||||
directFontResolveMask = data.fnt.resolve();
|
||||
data.fnt.resolve(newMask);
|
||||
directFontResolveMask = data.fnt.resolveMask();
|
||||
data.fnt.setResolveMask(newMask);
|
||||
|
||||
for (int i = 0; i < children.size(); ++i) {
|
||||
QWidget *w = qobject_cast<QWidget*>(children.at(i));
|
||||
|
@ -313,7 +313,7 @@ public:
|
||||
|
||||
void updateFont(const QFont &);
|
||||
inline void setFont_helper(const QFont &font) {
|
||||
if (directFontResolveMask == font.resolve() && data.fnt == font)
|
||||
if (directFontResolveMask == font.resolveMask() && data.fnt == font)
|
||||
return;
|
||||
updateFont(font);
|
||||
}
|
||||
@ -682,7 +682,7 @@ public:
|
||||
// Other variables.
|
||||
uint directFontResolveMask;
|
||||
uint inheritedFontResolveMask;
|
||||
decltype(std::declval<QPalette>().resolve()) directPaletteResolveMask;
|
||||
decltype(std::declval<QPalette>().resolveMask()) directPaletteResolveMask;
|
||||
QPalette::ResolveMask inheritedPaletteResolveMask;
|
||||
short leftmargin;
|
||||
short topmargin;
|
||||
|
@ -2679,13 +2679,13 @@ void QStyleSheetStyle::setPalette(QWidget *w)
|
||||
rule.configurePalette(&p, map[i].group, ew, ew != w);
|
||||
}
|
||||
|
||||
if (!useStyleSheetPropagationInWidgetStyles || p.resolve() != 0) {
|
||||
if (!useStyleSheetPropagationInWidgetStyles || p.resolveMask() != 0) {
|
||||
QPalette wp = w->palette();
|
||||
styleSheetCaches->customPaletteWidgets.insert(w, {wp, p.resolve()});
|
||||
styleSheetCaches->customPaletteWidgets.insert(w, {wp, p.resolveMask()});
|
||||
|
||||
if (useStyleSheetPropagationInWidgetStyles) {
|
||||
p = p.resolve(wp);
|
||||
p.resolve(p.resolve() | wp.resolve());
|
||||
p.setResolveMask(p.resolveMask() | wp.resolveMask());
|
||||
}
|
||||
|
||||
w->setPalette(p);
|
||||
@ -6109,18 +6109,18 @@ void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const
|
||||
if (useStyleSheetPropagationInWidgetStyles) {
|
||||
unsetStyleSheetFont(w);
|
||||
|
||||
if (rule.font.resolve()) {
|
||||
if (rule.font.resolveMask()) {
|
||||
QFont wf = w->d_func()->localFont();
|
||||
styleSheetCaches->customFontWidgets.insert(w, {wf, rule.font.resolve()});
|
||||
styleSheetCaches->customFontWidgets.insert(w, {wf, rule.font.resolveMask()});
|
||||
|
||||
QFont font = rule.font.resolve(wf);
|
||||
font.resolve(wf.resolve() | rule.font.resolve());
|
||||
font.setResolveMask(wf.resolveMask() | rule.font.resolveMask());
|
||||
w->setFont(font);
|
||||
}
|
||||
} else {
|
||||
QFont wf = w->d_func()->localFont();
|
||||
QFont font = rule.font.resolve(wf);
|
||||
font.resolve(wf.resolve() | rule.font.resolve());
|
||||
font.setResolveMask(wf.resolveMask() | rule.font.resolveMask());
|
||||
|
||||
if ((!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation))
|
||||
&& isNaturalChild(w) && qobject_cast<QWidget *>(w->parent())) {
|
||||
@ -6128,11 +6128,11 @@ void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const
|
||||
font = font.resolve(static_cast<QWidget *>(w->parent())->font());
|
||||
}
|
||||
|
||||
if (wf.resolve() == font.resolve() && wf == font)
|
||||
if (wf.resolveMask() == font.resolveMask() && wf == font)
|
||||
return;
|
||||
|
||||
w->data->fnt = font;
|
||||
w->d_func()->directFontResolveMask = font.resolve();
|
||||
w->d_func()->directFontResolveMask = font.resolveMask();
|
||||
|
||||
QEvent e(QEvent::FontChange);
|
||||
QCoreApplication::sendEvent(w, &e);
|
||||
|
@ -194,7 +194,7 @@ public:
|
||||
template <typename T>
|
||||
struct Tampered {
|
||||
T oldWidgetValue;
|
||||
decltype(std::declval<T>().resolve()) resolveMask;
|
||||
decltype(std::declval<T>().resolveMask()) resolveMask;
|
||||
|
||||
// only call this function on an rvalue *this (it mangles oldWidgetValue)
|
||||
T reverted(T current)
|
||||
@ -202,10 +202,10 @@ public:
|
||||
&&
|
||||
#endif
|
||||
{
|
||||
oldWidgetValue.resolve(oldWidgetValue.resolve() & resolveMask);
|
||||
current.resolve(current.resolve() & ~resolveMask);
|
||||
oldWidgetValue.setResolveMask(oldWidgetValue.resolveMask() & resolveMask);
|
||||
current.setResolveMask(current.resolveMask() & ~resolveMask);
|
||||
current.resolve(oldWidgetValue);
|
||||
current.resolve(current.resolve() | oldWidgetValue.resolve());
|
||||
current.setResolveMask(current.resolveMask() | oldWidgetValue.resolveMask());
|
||||
return current;
|
||||
}
|
||||
};
|
||||
|
@ -510,7 +510,7 @@ void tst_QGuiApplication::keyboardModifiers()
|
||||
*/
|
||||
static bool palettesMatch(const QPalette &actual, const QPalette &expected)
|
||||
{
|
||||
if (actual.resolve() != expected.resolve())
|
||||
if (actual.resolveMask() != expected.resolveMask())
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < QPalette::NColorGroups; i++) {
|
||||
@ -541,7 +541,7 @@ void tst_QGuiApplication::palette()
|
||||
QCOMPARE(QGuiApplication::palette(), QPalette());
|
||||
|
||||
// The default application palette is not resolved
|
||||
QVERIFY(!QGuiApplication::palette().resolve());
|
||||
QVERIFY(!QGuiApplication::palette().resolveMask());
|
||||
|
||||
QSignalSpy signalSpy(&app, SIGNAL(paletteChanged(QPalette)));
|
||||
|
||||
|
@ -132,7 +132,7 @@ static void compareAllPaletteData(const QPalette &firstPalette, const QPalette &
|
||||
// For historical reasons, operator== compares only brushes, but it's not enough for proper
|
||||
// comparison after move/copy, because some additional data can also be moved/copied.
|
||||
// Let's compare this data here.
|
||||
QCOMPARE(firstPalette.resolve(), secondPalette.resolve());
|
||||
QCOMPARE(firstPalette.resolveMask(), secondPalette.resolveMask());
|
||||
QCOMPARE(firstPalette.currentColorGroup(), secondPalette.currentColorGroup());
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ void tst_QPalette::setAllPossibleBrushes()
|
||||
{
|
||||
QPalette p;
|
||||
|
||||
QCOMPARE(p.resolve(), QPalette::ResolveMask(0));
|
||||
QCOMPARE(p.resolveMask(), QPalette::ResolveMask(0));
|
||||
|
||||
for (int r = 0; r < QPalette::NColorRoles; ++r) {
|
||||
p.setBrush(QPalette::All, QPalette::ColorRole(r), Qt::red);
|
||||
@ -248,7 +248,7 @@ void tst_QPalette::setAllPossibleBrushes()
|
||||
|
||||
void tst_QPalette::noBrushesSetForDefaultPalette()
|
||||
{
|
||||
QCOMPARE(QPalette().resolve(), QPalette::ResolveMask(0));
|
||||
QCOMPARE(QPalette().resolveMask(), QPalette::ResolveMask(0));
|
||||
}
|
||||
|
||||
void tst_QPalette::cannotCheckIfInvalidBrushSet()
|
||||
|
@ -322,22 +322,22 @@ void tst_QFont::resetFont()
|
||||
QWidget secondChild(&parent);
|
||||
secondChild.setFont(childFont);
|
||||
|
||||
QVERIFY(parentFont.resolve() != 0);
|
||||
QVERIFY(childFont.resolve() != 0);
|
||||
QVERIFY(parentFont.resolveMask() != 0);
|
||||
QVERIFY(childFont.resolveMask() != 0);
|
||||
QVERIFY(childFont != parentFont);
|
||||
|
||||
// reset font on both children
|
||||
firstChild.setFont(QFont());
|
||||
secondChild.setFont(QFont());
|
||||
|
||||
QCOMPARE(firstChild.font().resolve(), QFont::SizeResolved);
|
||||
QCOMPARE(secondChild.font().resolve(), QFont::SizeResolved);
|
||||
QCOMPARE(firstChild.font().resolveMask(), QFont::SizeResolved);
|
||||
QCOMPARE(secondChild.font().resolveMask(), QFont::SizeResolved);
|
||||
#ifdef Q_OS_ANDROID
|
||||
QEXPECT_FAIL("", "QTBUG-69214", Continue);
|
||||
#endif
|
||||
QCOMPARE(firstChild.font().pointSize(), parent.font().pointSize());
|
||||
QCOMPARE(secondChild.font().pointSize(), parent.font().pointSize());
|
||||
QVERIFY(parent.font().resolve() != 0);
|
||||
QVERIFY(parent.font().resolveMask() != 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -535,19 +535,19 @@ void tst_QTextFormat::setFont()
|
||||
QCOMPARE((int)f.font().capitalization(), (int)f.fontCapitalization());
|
||||
QCOMPARE(f.font().kerning(), f.fontKerning());
|
||||
|
||||
if (overrideAll || (font2.resolve() & QFont::StyleHintResolved))
|
||||
if (overrideAll || (font2.resolveMask() & QFont::StyleHintResolved))
|
||||
QCOMPARE((int)f.font().styleHint(), (int)font2.styleHint());
|
||||
else
|
||||
QCOMPARE((int)f.font().styleHint(), (int)font1.styleHint());
|
||||
if (overrideAll || (font2.resolve() & QFont::StyleStrategyResolved))
|
||||
if (overrideAll || (font2.resolveMask() & QFont::StyleStrategyResolved))
|
||||
QCOMPARE((int)f.font().styleStrategy(), (int)font2.styleStrategy());
|
||||
else
|
||||
QCOMPARE((int)f.font().styleStrategy(), (int)font1.styleStrategy());
|
||||
if (overrideAll || (font2.resolve() & QFont::CapitalizationResolved))
|
||||
if (overrideAll || (font2.resolveMask() & QFont::CapitalizationResolved))
|
||||
QCOMPARE((int)f.font().capitalization(), (int)font2.capitalization());
|
||||
else
|
||||
QCOMPARE((int)f.font().capitalization(), (int)font1.capitalization());
|
||||
if (overrideAll || (font2.resolve() & QFont::KerningResolved))
|
||||
if (overrideAll || (font2.resolveMask() & QFont::KerningResolved))
|
||||
QCOMPARE(f.font().kerning(), font2.kerning());
|
||||
else
|
||||
QCOMPARE(f.font().kerning(), font1.kerning());
|
||||
@ -639,19 +639,19 @@ void tst_QTextFormat::setFont_collection()
|
||||
int formatIndex = collection.indexForFormat(tmp);
|
||||
QTextCharFormat f = collection.charFormat(formatIndex);
|
||||
|
||||
if (overrideAll || (font2.resolve() & QFont::StyleHintResolved))
|
||||
if (overrideAll || (font2.resolveMask() & QFont::StyleHintResolved))
|
||||
QCOMPARE((int)f.font().styleHint(), (int)font2.styleHint());
|
||||
else
|
||||
QCOMPARE((int)f.font().styleHint(), (int)font1.styleHint());
|
||||
if (overrideAll || (font2.resolve() & QFont::StyleStrategyResolved))
|
||||
if (overrideAll || (font2.resolveMask() & QFont::StyleStrategyResolved))
|
||||
QCOMPARE((int)f.font().styleStrategy(), (int)font2.styleStrategy());
|
||||
else
|
||||
QCOMPARE((int)f.font().styleStrategy(), (int)font1.styleStrategy());
|
||||
if (overrideAll || (font2.resolve() & QFont::CapitalizationResolved))
|
||||
if (overrideAll || (font2.resolveMask() & QFont::CapitalizationResolved))
|
||||
QCOMPARE((int)f.font().capitalization(), (int)font2.capitalization());
|
||||
else
|
||||
QCOMPARE((int)f.font().capitalization(), (int)font1.capitalization());
|
||||
if (overrideAll || (font2.resolve() & QFont::KerningResolved))
|
||||
if (overrideAll || (font2.resolveMask() & QFont::KerningResolved))
|
||||
QCOMPARE(f.font().kerning(), font2.kerning());
|
||||
else
|
||||
QCOMPARE(f.font().kerning(), font1.kerning());
|
||||
|
@ -640,11 +640,11 @@ void tst_QGraphicsWidget::fontPropagatesResolveToChildren()
|
||||
view.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||
|
||||
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(root->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child1->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child2->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child3->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(font.resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(root->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child1->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child2->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child3->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
}
|
||||
|
||||
void tst_QGraphicsWidget::fontPropagatesResolveToGrandChildren()
|
||||
@ -675,12 +675,12 @@ void tst_QGraphicsWidget::fontPropagatesResolveToGrandChildren()
|
||||
view.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||
|
||||
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild3->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild4->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild5->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(font.resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild1->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild3->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild4->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild5->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
}
|
||||
|
||||
void tst_QGraphicsWidget::fontPropagatesResolveViaNonWidget()
|
||||
@ -711,12 +711,12 @@ void tst_QGraphicsWidget::fontPropagatesResolveViaNonWidget()
|
||||
view.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||
|
||||
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild3->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild4->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild5->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(font.resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild1->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild3->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild4->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild5->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
}
|
||||
|
||||
void tst_QGraphicsWidget::fontPropagatesResolveFromScene()
|
||||
@ -747,16 +747,16 @@ void tst_QGraphicsWidget::fontPropagatesResolveFromScene()
|
||||
view.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||
|
||||
QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(root->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child1->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child2->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child3->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild3->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild4->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild5->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(font.resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(root->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child1->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child2->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(child3->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild1->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild3->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild4->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild5->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
}
|
||||
|
||||
void tst_QGraphicsWidget::fontPropagatesResolveInParentChange()
|
||||
@ -785,8 +785,8 @@ void tst_QGraphicsWidget::fontPropagatesResolveInParentChange()
|
||||
QVERIFY(!grandChild2->font().italic());
|
||||
QVERIFY(grandChild2->font().bold());
|
||||
|
||||
QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolve(), uint(QFont::WeightResolved));
|
||||
QCOMPARE(grandChild1->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolveMask(), uint(QFont::WeightResolved));
|
||||
|
||||
grandChild2->setParentItem(child1);
|
||||
|
||||
@ -800,8 +800,8 @@ void tst_QGraphicsWidget::fontPropagatesResolveInParentChange()
|
||||
QVERIFY(grandChild2->font().italic());
|
||||
QVERIFY(!grandChild2->font().bold());
|
||||
|
||||
QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolve(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild1->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
QCOMPARE(grandChild2->font().resolveMask(), uint(QFont::StyleResolved));
|
||||
|
||||
}
|
||||
|
||||
@ -911,12 +911,12 @@ void tst_QGraphicsWidget::fontPropagationWidgetItemWidget()
|
||||
widget->setFont(font);
|
||||
|
||||
QCOMPARE(widget2->font().pointSize(), 43);
|
||||
QCOMPARE(widget2->font().resolve(), uint(QFont::SizeResolved));
|
||||
QCOMPARE(widget2->font().resolveMask(), uint(QFont::SizeResolved));
|
||||
|
||||
widget->setFont(QFont());
|
||||
|
||||
QCOMPARE(widget2->font().pointSize(), qApp->font().pointSize());
|
||||
QCOMPARE(widget2->font().resolve(), QFont().resolve());
|
||||
QCOMPARE(widget2->font().resolveMask(), QFont().resolveMask());
|
||||
}
|
||||
|
||||
void tst_QGraphicsWidget::fontPropagationSceneChange()
|
||||
|
@ -1836,7 +1836,7 @@ void tst_QApplication::applicationPalettePolish()
|
||||
qputenv("QT_DESKTOP_STYLE_KEY", "customstyle");
|
||||
QApplication app(argc, &argv0);
|
||||
QVERIFY(CustomStyle::polished);
|
||||
QVERIFY(!app.palette().resolve());
|
||||
QVERIFY(!app.palette().resolveMask());
|
||||
QCOMPARE(app.palette().color(QPalette::Link), Qt::red);
|
||||
qunsetenv("QT_DESKTOP_STYLE_KEY");
|
||||
}
|
||||
@ -1846,7 +1846,7 @@ void tst_QApplication::applicationPalettePolish()
|
||||
QApplication::setStyle(new CustomStyle);
|
||||
QApplication app(argc, &argv0);
|
||||
QVERIFY(CustomStyle::polished);
|
||||
QVERIFY(!app.palette().resolve());
|
||||
QVERIFY(!app.palette().resolveMask());
|
||||
QCOMPARE(app.palette().color(QPalette::Link), Qt::red);
|
||||
}
|
||||
|
||||
@ -1854,13 +1854,13 @@ void tst_QApplication::applicationPalettePolish()
|
||||
QApplication app(argc, &argv0);
|
||||
app.setStyle(new CustomStyle);
|
||||
QVERIFY(CustomStyle::polished);
|
||||
QVERIFY(!app.palette().resolve());
|
||||
QVERIFY(!app.palette().resolveMask());
|
||||
QCOMPARE(app.palette().color(QPalette::Link), Qt::red);
|
||||
|
||||
CustomStyle::polished = 0;
|
||||
app.setPalette(QPalette());
|
||||
QVERIFY(CustomStyle::polished);
|
||||
QVERIFY(!app.palette().resolve());
|
||||
QVERIFY(!app.palette().resolveMask());
|
||||
QCOMPARE(app.palette().color(QPalette::Link), Qt::red);
|
||||
|
||||
CustomStyle::polished = 0;
|
||||
@ -1868,7 +1868,7 @@ void tst_QApplication::applicationPalettePolish()
|
||||
palette.setColor(QPalette::Active, QPalette::Highlight, Qt::green);
|
||||
app.setPalette(palette);
|
||||
QVERIFY(CustomStyle::polished);
|
||||
QVERIFY(app.palette().resolve());
|
||||
QVERIFY(app.palette().resolveMask());
|
||||
QCOMPARE(app.palette().color(QPalette::Link), Qt::red);
|
||||
QCOMPARE(app.palette().color(QPalette::Highlight), Qt::green);
|
||||
}
|
||||
|
@ -2111,13 +2111,13 @@ void tst_QStyleSheetStyle::widgetStylePropagation()
|
||||
QLabel childLabel(&parentLabel);
|
||||
childLabel.setObjectName("childLabel");
|
||||
|
||||
if (parentFont.resolve())
|
||||
if (parentFont.resolveMask())
|
||||
parentLabel.setFont(parentFont);
|
||||
if (childFont.resolve())
|
||||
if (childFont.resolveMask())
|
||||
childLabel.setFont(childFont);
|
||||
if (parentPalette.resolve())
|
||||
if (parentPalette.resolveMask())
|
||||
parentLabel.setPalette(parentPalette);
|
||||
if (childPalette.resolve())
|
||||
if (childPalette.resolveMask())
|
||||
childLabel.setPalette(childPalette);
|
||||
if (!parentStyleSheet.isEmpty())
|
||||
parentLabel.setStyleSheet(parentStyleSheet);
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
p.setPen(palette().text().color());
|
||||
|
||||
QFont f = font();
|
||||
f.resolve(-1);
|
||||
f.setResolveMask(-1);
|
||||
p.setFont(f);
|
||||
|
||||
p.drawText(QPoint(0, ascent), text());
|
||||
|
Loading…
x
Reference in New Issue
Block a user