Rename accent color in QPalette

Accent color role has been renamed according to name rule of other
color roles in QPalette.

Fixes: QTBUG-116107
Change-Id: I70ac98a1e97afbdc7ea5f8d79f808c307e170712
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 90980a54e87147ae59ed0628f8b1de67d98ecae4)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Santhosh Kumar 2023-08-16 13:56:29 +02:00
parent e4d4714aae
commit 4781de5859
14 changed files with 49 additions and 49 deletions

View File

@ -16,15 +16,15 @@ static int qt_palette_count = 1;
static constexpr QPalette::ResolveMask colorRoleOffset(QPalette::ColorGroup colorGroup) static constexpr QPalette::ResolveMask colorRoleOffset(QPalette::ColorGroup colorGroup)
{ {
// Exclude NoRole; that bit is used for AccentColor // Exclude NoRole; that bit is used for Accent
return (qToUnderlying(QPalette::NColorRoles) - 1) * qToUnderlying(colorGroup); return (qToUnderlying(QPalette::NColorRoles) - 1) * qToUnderlying(colorGroup);
} }
static constexpr QPalette::ResolveMask bitPosition(QPalette::ColorGroup colorGroup, static constexpr QPalette::ResolveMask bitPosition(QPalette::ColorGroup colorGroup,
QPalette::ColorRole colorRole) QPalette::ColorRole colorRole)
{ {
// Map AccentColor into NoRole for resolving purposes // Map Accent into NoRole for resolving purposes
if (colorRole == QPalette::AccentColor) if (colorRole == QPalette::Accent)
colorRole = QPalette::NoRole; colorRole = QPalette::NoRole;
return colorRole + colorRoleOffset(colorGroup); return colorRole + colorRoleOffset(colorGroup);
@ -113,12 +113,12 @@ static void qt_ensure_default_accent_color(QPalette &pal)
// Act only for color groups where no accent color is set // Act only for color groups where no accent color is set
for (int i = 0; i < QPalette::NColorGroups; ++i) { for (int i = 0; i < QPalette::NColorGroups; ++i) {
const QPalette::ColorGroup group = static_cast<QPalette::ColorGroup>(i); const QPalette::ColorGroup group = static_cast<QPalette::ColorGroup>(i);
if (!pal.isBrushSet(group, QPalette::AccentColor)) { if (!pal.isBrushSet(group, QPalette::Accent)) {
// Default to highlight if available, otherwise use a shade of base // Default to highlight if available, otherwise use a shade of base
const QBrush accentBrush = pal.isBrushSet(group, QPalette::Highlight) const QBrush accentBrush = pal.isBrushSet(group, QPalette::Highlight)
? pal.brush(group, QPalette::Highlight) ? pal.brush(group, QPalette::Highlight)
: pal.brush(group, QPalette::Base).color().lighter(lighter); : pal.brush(group, QPalette::Base).color().lighter(lighter);
pal.setBrush(group, QPalette::AccentColor, accentBrush); pal.setBrush(group, QPalette::Accent, accentBrush);
} }
} }
} }
@ -548,7 +548,7 @@ static void qt_palette_from_color(QPalette &pal, const QColor &button)
item. By default, the highlight color is item. By default, the highlight color is
Qt::darkBlue. Qt::darkBlue.
\value [since 6.6] AccentColor \value [since 6.6] Accent
A color that typically contrasts or complements A color that typically contrasts or complements
Base, Window and Button colors. It usually represents Base, Window and Button colors. It usually represents
the users' choice of desktop personalisation. the users' choice of desktop personalisation.
@ -1022,7 +1022,7 @@ QPalette QPalette::resolve(const QPalette &other) const
palette.detach(); palette.detach();
for (int role = 0; role < int(NColorRoles); ++role) { for (int role = 0; role < int(NColorRoles); ++role) {
// Don't resolve NoRole, its bits are needed for AccentColor (see bitPosition) // Don't resolve NoRole, its bits are needed for Accent (see bitPosition)
if (role == NoRole) if (role == NoRole)
continue; continue;
@ -1161,9 +1161,9 @@ QDataStream &operator>>(QDataStream &s, QPalette &p)
p.setBrush(group, (QPalette::ColorRole)role, tmp); p.setBrush(group, (QPalette::ColorRole)role, tmp);
} }
// AccentColor defaults to Highlight for stream versions that don't have it. // Accent defaults to Highlight for stream versions that don't have it.
if (s.version() < QDataStream::Qt_6_6) if (s.version() < QDataStream::Qt_6_6)
p.setBrush(group, QPalette::AccentColor, p.brush(group, QPalette::Highlight)); p.setBrush(group, QPalette::Accent, p.brush(group, QPalette::Highlight));
} }
} }

View File

@ -55,8 +55,8 @@ public:
NoRole, NoRole,
ToolTipBase, ToolTipText, ToolTipBase, ToolTipText,
PlaceholderText, PlaceholderText,
AccentColor, Accent,
NColorRoles = AccentColor + 1, NColorRoles = Accent + 1,
}; };
Q_ENUM(ColorRole) Q_ENUM(ColorRole)
@ -99,7 +99,7 @@ public:
inline const QBrush &link() const { return brush(Link); } inline const QBrush &link() const { return brush(Link); }
inline const QBrush &linkVisited() const { return brush(LinkVisited); } inline const QBrush &linkVisited() const { return brush(LinkVisited); }
inline const QBrush &placeholderText() const { return brush(PlaceholderText); } inline const QBrush &placeholderText() const { return brush(PlaceholderText); }
inline const QBrush &accentColor() const { return brush(AccentColor); } inline const QBrush &accent() const { return brush(Accent); }
bool operator==(const QPalette &p) const; bool operator==(const QPalette &p) const;
inline bool operator!=(const QPalette &p) const { return !(operator==(p)); } inline bool operator!=(const QPalette &p) const { return !(operator==(p)); }

View File

@ -395,9 +395,9 @@ Q_GUI_EXPORT QPalette qt_fusionPalette()
fusionPalette.setBrush(QPalette::Inactive, QPalette::Highlight, highlight); fusionPalette.setBrush(QPalette::Inactive, QPalette::Highlight, highlight);
fusionPalette.setBrush(QPalette::Disabled, QPalette::Highlight, disabledHighlight); fusionPalette.setBrush(QPalette::Disabled, QPalette::Highlight, disabledHighlight);
fusionPalette.setBrush(QPalette::Active, QPalette::AccentColor, highlight); fusionPalette.setBrush(QPalette::Active, QPalette::Accent, highlight);
fusionPalette.setBrush(QPalette::Inactive, QPalette::AccentColor, highlight); fusionPalette.setBrush(QPalette::Inactive, QPalette::Accent, highlight);
fusionPalette.setBrush(QPalette::Disabled, QPalette::AccentColor, disabledHighlight); fusionPalette.setBrush(QPalette::Disabled, QPalette::Accent, disabledHighlight);
fusionPalette.setBrush(QPalette::PlaceholderText, placeholder); fusionPalette.setBrush(QPalette::PlaceholderText, placeholder);

View File

@ -47,7 +47,7 @@ static const QCssKnownValue properties[NumProperties - 1] = {
{ "-qt-style-features", QtStyleFeatures }, { "-qt-style-features", QtStyleFeatures },
{ "-qt-table-type", QtTableType }, { "-qt-table-type", QtTableType },
{ "-qt-user-state", QtUserState }, { "-qt-user-state", QtUserState },
{ "accent-color", QtAccentColor }, { "accent-color", QtAccent },
{ "alternate-background-color", QtAlternateBackground }, { "alternate-background-color", QtAlternateBackground },
{ "background", Background }, { "background", Background },
{ "background-attachment", BackgroundAttachment }, { "background-attachment", BackgroundAttachment },
@ -1347,7 +1347,7 @@ bool ValueExtractor::extractPalette(QBrush *foreground,
QBrush *selectedBackground, QBrush *selectedBackground,
QBrush *alternateBackground, QBrush *alternateBackground,
QBrush *placeHolderTextForeground, QBrush *placeHolderTextForeground,
QBrush *accentColor) QBrush *accent)
{ {
bool hit = false; bool hit = false;
for (int i = 0; i < declarations.size(); ++i) { for (int i = 0; i < declarations.size(); ++i) {
@ -1358,7 +1358,7 @@ bool ValueExtractor::extractPalette(QBrush *foreground,
case QtSelectionBackground: *selectedBackground = decl.brushValue(pal); break; case QtSelectionBackground: *selectedBackground = decl.brushValue(pal); break;
case QtAlternateBackground: *alternateBackground = decl.brushValue(pal); break; case QtAlternateBackground: *alternateBackground = decl.brushValue(pal); break;
case QtPlaceHolderTextColor: *placeHolderTextForeground = decl.brushValue(pal); break; case QtPlaceHolderTextColor: *placeHolderTextForeground = decl.brushValue(pal); break;
case QtAccentColor: *accentColor = decl.brushValue(pal); break; case QtAccent: *accent = decl.brushValue(pal); break;
default: continue; default: continue;
} }
hit = true; hit = true;

View File

@ -166,7 +166,7 @@ enum Property {
WordSpacing, WordSpacing,
TextDecorationColor, TextDecorationColor,
QtPlaceHolderTextColor, QtPlaceHolderTextColor,
QtAccentColor, QtAccent,
NumProperties NumProperties
}; };
@ -826,7 +826,7 @@ struct Q_GUI_EXPORT ValueExtractor
bool extractOutline(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii, int *offsets); bool extractOutline(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii, int *offsets);
bool extractPalette(QBrush *foreground, QBrush *selectedForeground, QBrush *selectedBackground, bool extractPalette(QBrush *foreground, QBrush *selectedForeground, QBrush *selectedBackground,
QBrush *alternateBackground, QBrush *placeHolderTextForeground, QBrush *alternateBackground, QBrush *placeHolderTextForeground,
QBrush *accentColor); QBrush *accent);
int extractStyleFeatures(); int extractStyleFeatures();
bool extractImage(QIcon *icon, Qt::Alignment *a, QSize *size); bool extractImage(QIcon *icon, Qt::Alignment *a, QSize *size);
bool extractIcon(QIcon *icon, QSize *size); bool extractIcon(QIcon *icon, QSize *size);

View File

@ -95,7 +95,7 @@ static QPalette *qt_mac_createSystemPalette()
palette->setColor(QPalette::Disabled, QPalette::PlaceholderText, qc); palette->setColor(QPalette::Disabled, QPalette::PlaceholderText, qc);
qc = qt_mac_toQColor([NSColor controlAccentColor]); qc = qt_mac_toQColor([NSColor controlAccentColor]);
palette->setColor(QPalette::AccentColor, qc); palette->setColor(QPalette::Accent, qc);
return palette; return palette;
} }

View File

@ -70,7 +70,7 @@ void QIOSTheme::initializeSystemPalette()
s_systemPalette.setBrush(QPalette::Highlight, QColor(11, 70, 150, 60)); s_systemPalette.setBrush(QPalette::Highlight, QColor(11, 70, 150, 60));
s_systemPalette.setBrush(QPalette::HighlightedText, qt_mac_toQBrush(UIColor.labelColor.CGColor)); s_systemPalette.setBrush(QPalette::HighlightedText, qt_mac_toQBrush(UIColor.labelColor.CGColor));
s_systemPalette.setBrush(QPalette::AccentColor, qt_mac_toQBrush(UIColor.tintColor.CGColor)); s_systemPalette.setBrush(QPalette::Accent, qt_mac_toQBrush(UIColor.tintColor.CGColor));
} }
const QPalette *QIOSTheme::palette(QPlatformTheme::Palette type) const const QPalette *QIOSTheme::palette(QPlatformTheme::Palette type) const

View File

@ -277,7 +277,7 @@ static void populateLightSystemBasePalette(QPalette &result)
result.setColor(QPalette::Midlight, getSysColor(COLOR_3DLIGHT)); result.setColor(QPalette::Midlight, getSysColor(COLOR_3DLIGHT));
result.setColor(QPalette::Shadow, getSysColor(COLOR_3DDKSHADOW)); result.setColor(QPalette::Shadow, getSysColor(COLOR_3DDKSHADOW));
result.setColor(QPalette::HighlightedText, getSysColor(COLOR_HIGHLIGHTTEXT)); result.setColor(QPalette::HighlightedText, getSysColor(COLOR_HIGHLIGHTTEXT));
result.setColor(QPalette::AccentColor, accent); result.setColor(QPalette::Accent, accent);
result.setColor(QPalette::Link, linkColor); result.setColor(QPalette::Link, linkColor);
result.setColor(QPalette::LinkVisited, accentDarkest); result.setColor(QPalette::LinkVisited, accentDarkest);
@ -351,7 +351,7 @@ static void populateDarkSystemBasePalette(QPalette &result)
result.setColor(QPalette::All, QPalette::ToolTipBase, buttonColor); result.setColor(QPalette::All, QPalette::ToolTipBase, buttonColor);
result.setColor(QPalette::All, QPalette::ToolTipText, foreground.darker(120)); result.setColor(QPalette::All, QPalette::ToolTipText, foreground.darker(120));
result.setColor(QPalette::All, QPalette::PlaceholderText, placeHolderColor(foreground)); result.setColor(QPalette::All, QPalette::PlaceholderText, placeHolderColor(foreground));
result.setColor(QPalette::All, QPalette::AccentColor, accent); result.setColor(QPalette::All, QPalette::Accent, accent);
} }
static inline QPalette toolTipPalette(const QPalette &systemPalette, bool light) static inline QPalette toolTipPalette(const QPalette &systemPalette, bool light)
@ -591,7 +591,7 @@ QPalette QWindowsTheme::systemPalette(Qt::ColorScheme colorScheme)
result.color(QPalette::Inactive, QPalette::Window)); result.color(QPalette::Inactive, QPalette::Window));
result.setColor(QPalette::Inactive, QPalette::HighlightedText, result.setColor(QPalette::Inactive, QPalette::HighlightedText,
result.color(QPalette::Inactive, QPalette::Text)); result.color(QPalette::Inactive, QPalette::Text));
result.setColor(QPalette::Inactive, QPalette::AccentColor, result.setColor(QPalette::Inactive, QPalette::Accent,
result.color(QPalette::Inactive, QPalette::Window)); result.color(QPalette::Inactive, QPalette::Window));
} }
@ -606,7 +606,7 @@ QPalette QWindowsTheme::systemPalette(Qt::ColorScheme colorScheme)
result.setColor(QPalette::Disabled, QPalette::ButtonText, disabled); result.setColor(QPalette::Disabled, QPalette::ButtonText, disabled);
result.setColor(QPalette::Disabled, QPalette::Highlight, result.color(QPalette::Highlight)); result.setColor(QPalette::Disabled, QPalette::Highlight, result.color(QPalette::Highlight));
result.setColor(QPalette::Disabled, QPalette::HighlightedText, result.color(QPalette::HighlightedText)); result.setColor(QPalette::Disabled, QPalette::HighlightedText, result.color(QPalette::HighlightedText));
result.setColor(QPalette::Disabled, QPalette::AccentColor, disabled); result.setColor(QPalette::Disabled, QPalette::Accent, disabled);
result.setColor(QPalette::Disabled, QPalette::Base, result.window().color()); result.setColor(QPalette::Disabled, QPalette::Base, result.window().color());
return result; return result;
} }

View File

@ -1345,7 +1345,7 @@
\row \row
\li \b{\c accent-color} \li \b{\c accent-color}
\li \l{#Brush}{Brush} \br \li \l{#Brush}{Brush} \br
\li The property sets the \c AccentColor, which is used to emphasize \li The property sets the \c Accent, which is used to emphasize
interactive UI elements. interactive UI elements.
If this property is not set, it defaults to the \c highlight color. If this property is not set, it defaults to the \c highlight color.
@ -3056,7 +3056,7 @@
\row \row
\li \b{PaletteRole} \target PaletteRole \li \b{PaletteRole} \target PaletteRole
\li \c alternate-base \br \li \c alternate-base \br
| \c accentColor \br | \c accent \br
| \c base \br | \c base \br
| \c bright-text \br | \c bright-text \br
| \c button \br | \c button \br

View File

@ -439,13 +439,13 @@ struct QStyleSheetPaletteData : public QSharedData
const QBrush &selectedBackground, const QBrush &selectedBackground,
const QBrush &alternateBackground, const QBrush &alternateBackground,
const QBrush &placeHolderTextForeground, const QBrush &placeHolderTextForeground,
const QBrush &accentColor) const QBrush &accent)
: foreground(foreground) : foreground(foreground)
, selectionForeground(selectedForeground) , selectionForeground(selectedForeground)
, selectionBackground(selectedBackground) , selectionBackground(selectedBackground)
, alternateBackground(alternateBackground) , alternateBackground(alternateBackground)
, placeholderForeground(placeHolderTextForeground) , placeholderForeground(placeHolderTextForeground)
, accentColor(accentColor) , accent(accent)
{ } { }
QBrush foreground; QBrush foreground;
@ -453,7 +453,7 @@ struct QStyleSheetPaletteData : public QSharedData
QBrush selectionBackground; QBrush selectionBackground;
QBrush alternateBackground; QBrush alternateBackground;
QBrush placeholderForeground; QBrush placeholderForeground;
QBrush accentColor; QBrush accent;
}; };
struct QStyleSheetGeometryData : public QSharedData struct QStyleSheetGeometryData : public QSharedData
@ -970,11 +970,11 @@ QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject *
QBrush selectedBackground; QBrush selectedBackground;
QBrush alternateBackground; QBrush alternateBackground;
QBrush placeHolderTextForeground; QBrush placeHolderTextForeground;
QBrush accentColor; QBrush accent;
if (v.extractPalette(&foreground, &selectedForeground, &selectedBackground, if (v.extractPalette(&foreground, &selectedForeground, &selectedBackground,
&alternateBackground, &placeHolderTextForeground, &accentColor)) { &alternateBackground, &placeHolderTextForeground, &accent)) {
pal = new QStyleSheetPaletteData(foreground, selectedForeground, selectedBackground, pal = new QStyleSheetPaletteData(foreground, selectedForeground, selectedBackground,
alternateBackground, placeHolderTextForeground, accentColor); alternateBackground, placeHolderTextForeground, accent);
} }
QIcon imgIcon; QIcon imgIcon;
@ -1514,8 +1514,8 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const Q
p->setBrush(cg, QPalette::AlternateBase, pal->alternateBackground); p->setBrush(cg, QPalette::AlternateBase, pal->alternateBackground);
if (pal->placeholderForeground.style() != Qt::NoBrush) if (pal->placeholderForeground.style() != Qt::NoBrush)
p->setBrush(cg, QPalette::PlaceholderText, pal->placeholderForeground); p->setBrush(cg, QPalette::PlaceholderText, pal->placeholderForeground);
if (pal->accentColor.style() != Qt::NoBrush) if (pal->accent.style() != Qt::NoBrush)
p->setBrush(cg, QPalette::AccentColor, pal->accentColor); p->setBrush(cg, QPalette::Accent, pal->accent);
} }
bool QRenderRule::hasModification() const bool QRenderRule::hasModification() const

View File

@ -295,7 +295,7 @@ static int NColorRoles[] = {
QPalette::PlaceholderText + 1, // Qt_5_12 QPalette::PlaceholderText + 1, // Qt_5_12
QPalette::PlaceholderText + 1, // Qt_5_13, Qt_5_14, Qt_5_15 QPalette::PlaceholderText + 1, // Qt_5_13, Qt_5_14, Qt_5_15
QPalette::PlaceholderText + 1, // Qt_6_0 QPalette::PlaceholderText + 1, // Qt_6_0
QPalette::AccentColor + 1, // Qt_6_6 QPalette::Accent + 1, // Qt_6_6
0 // add the correct value for Qt_5_14 here later 0 // add the correct value for Qt_5_14 here later
}; };
@ -2393,7 +2393,7 @@ void tst_QDataStream::setVersion()
*/ */
// revise the test if new color roles or color groups are added // revise the test if new color roles or color groups are added
QCOMPARE(QPalette::NColorRoles, QPalette::AccentColor + 1); QCOMPARE(QPalette::NColorRoles, QPalette::Accent + 1);
QCOMPARE(static_cast<int>(QPalette::NColorGroups), 3); QCOMPARE(static_cast<int>(QPalette::NColorGroups), 3);
QByteArray ba2; QByteArray ba2;

View File

@ -52,7 +52,7 @@ void tst_QPalette::roleValues_data()
QTest::newRow("QPalette::ToolTipBase") << int(QPalette::ToolTipBase) << 18; QTest::newRow("QPalette::ToolTipBase") << int(QPalette::ToolTipBase) << 18;
QTest::newRow("QPalette::ToolTipText") << int(QPalette::ToolTipText) << 19; QTest::newRow("QPalette::ToolTipText") << int(QPalette::ToolTipText) << 19;
QTest::newRow("QPalette::PlaceholderText") << int(QPalette::PlaceholderText) << 20; QTest::newRow("QPalette::PlaceholderText") << int(QPalette::PlaceholderText) << 20;
QTest::newRow("QPalette::AccentColor") << int(QPalette::AccentColor) << 21; QTest::newRow("QPalette::Accent") << int(QPalette::Accent) << 21;
// Change this value as you add more roles. // Change this value as you add more roles.
QTest::newRow("QPalette::NColorRoles") << int(QPalette::NColorRoles) << 22; QTest::newRow("QPalette::NColorRoles") << int(QPalette::NColorRoles) << 22;
@ -355,9 +355,9 @@ void tst_QPalette::dataStream()
const QColor accent(13, 13, 13); const QColor accent(13, 13, 13);
QPalette palette; QPalette palette;
palette.setBrush(QPalette::Highlight, highlight); palette.setBrush(QPalette::Highlight, highlight);
palette.setBrush(QPalette::AccentColor, accent); palette.setBrush(QPalette::Accent, accent);
// When saved with Qt_6_5 or earlier, AccentColor defaults to Highlight // When saved with Qt_6_5 or earlier, Accent defaults to Highlight
{ {
QByteArray b; QByteArray b;
{ {
@ -369,10 +369,10 @@ void tst_QPalette::dataStream()
QDataStream stream (&b, QIODevice::ReadOnly); QDataStream stream (&b, QIODevice::ReadOnly);
stream.setVersion(QDataStream::Qt_6_5); stream.setVersion(QDataStream::Qt_6_5);
stream >> test; stream >> test;
QCOMPARE(test.accentColor().color(), highlight); QCOMPARE(test.accent().color(), highlight);
} }
// When saved with Qt_6_6 or later, AccentColor is saved explicitly // When saved with Qt_6_6 or later, Accent is saved explicitly
{ {
QByteArray b; QByteArray b;
{ {
@ -384,7 +384,7 @@ void tst_QPalette::dataStream()
QDataStream stream (&b, QIODevice::ReadOnly); QDataStream stream (&b, QIODevice::ReadOnly);
stream.setVersion(QDataStream::Qt_6_6); stream.setVersion(QDataStream::Qt_6_6);
stream >> test; stream >> test;
QCOMPARE(test.accentColor().color(), accent); QCOMPARE(test.accent().color(), accent);
} }
} }

View File

@ -1548,9 +1548,9 @@ void tst_QCssParser::gradient()
QBrush selectedBackground; QBrush selectedBackground;
QBrush alternateBackground; QBrush alternateBackground;
QBrush placeHolderTextForeground; QBrush placeHolderTextForeground;
QBrush accentColor; QBrush accent;
QVERIFY(ve.extractPalette(&foreground, &selectedForeground, &selectedBackground, QVERIFY(ve.extractPalette(&foreground, &selectedForeground, &selectedBackground,
&alternateBackground, &placeHolderTextForeground, &accentColor)); &alternateBackground, &placeHolderTextForeground, &accent));
if (type == "linear") { if (type == "linear") {
QCOMPARE(selectedBackground.style(), Qt::LinearGradientPattern); QCOMPARE(selectedBackground.style(), Qt::LinearGradientPattern);

View File

@ -106,7 +106,7 @@ private slots:
void QTBUG36933_brokenPseudoClassLookup(); void QTBUG36933_brokenPseudoClassLookup();
void styleSheetChangeBeforePolish(); void styleSheetChangeBeforePolish();
void placeholderColor(); void placeholderColor();
void accentColor(); void accent();
void enumPropertySelector_data(); void enumPropertySelector_data();
void enumPropertySelector(); void enumPropertySelector();
//at the end because it mess with the style. //at the end because it mess with the style.
@ -2363,13 +2363,13 @@ void tst_QStyleSheetStyle::placeholderColor()
QCOMPARE(le1.palette().placeholderText().color(), QColor(phSpec)); QCOMPARE(le1.palette().placeholderText().color(), QColor(phSpec));
} }
void tst_QStyleSheetStyle::accentColor() void tst_QStyleSheetStyle::accent()
{ {
QLineEdit lineEdit; QLineEdit lineEdit;
const QColor universe(42, 42, 42); const QColor universe(42, 42, 42);
lineEdit.setStyleSheet(QString("QLineEdit { accent-color: %1; }").arg(universe.name())); lineEdit.setStyleSheet(QString("QLineEdit { accent-color: %1; }").arg(universe.name()));
lineEdit.ensurePolished(); lineEdit.ensurePolished();
QCOMPARE(lineEdit.palette().accentColor().color(), universe); QCOMPARE(lineEdit.palette().accent().color(), universe);
} }
void tst_QStyleSheetStyle::enumPropertySelector_data() void tst_QStyleSheetStyle::enumPropertySelector_data()