if you call setHighlightColor(color) // color == getPaletteColor("selected", "background") then customColor is not set to true, and you are still watching for palette updates, while it may be purely coincidence that you set the color to the palette color. So customColor = true should be moved before the if() (maybe update() too).
void UCListItem: :setHighlightCo lor(const QColor &color) UCListItem) ; highlightColor = color; hanged( ); :resetHighlight Color() UCListItem) ; highlightColor = getPaletteColor ("selected" , "background"); hanged( );
{
Q_D(
if (d->highlightColor == color) {
return;
}
d->
// no more theme change watch
d->customColor = true;
update();
Q_EMIT highlightColorC
}
void UCListItem:
{
Q_D(
d->customColor = false;
d->
update();
Q_EMIT highlightColorC
}
if you call setHighlightCol or(color) // color == getPaletteColor ("selected" , "background") then customColor is not set to true, and you are still watching for palette updates, while it may be purely coincidence that you set the color to the palette color. So customColor = true should be moved before the if() (maybe update() too).