> void UCListItem::setHighlightColor(const QColor &color)
> {
> Q_D(UCListItem);
> if (d->highlightColor == color) {
> return;
> }
> d->highlightColor = color;
> // no more theme change watch
> d->customColor = true;
> update();
> Q_EMIT highlightColorChanged();
> }
> void UCListItem::resetHighlightColor()
> {
> Q_D(UCListItem);
> d->customColor = false;
> d->highlightColor = getPaletteColor("selected", "background");
> update();
> Q_EMIT highlightColorChanged();
> }
>
>
> 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).
Well, if a property's default value is set again as value, there will be no change done either.
> void UCListItem: :setHighlightCo lor(const QColor &color) hanged( ); :resetHighlight Color() ("selected" , "background"); hanged( ); or(color) // color == getPaletteColor ("selected" ,
> {
> Q_D(UCListItem);
> if (d->highlightColor == color) {
> return;
> }
> d->highlightColor = color;
> // no more theme change watch
> d->customColor = true;
> update();
> Q_EMIT highlightColorC
> }
> void UCListItem:
> {
> Q_D(UCListItem);
> d->customColor = false;
> d->highlightColor = getPaletteColor
> update();
> Q_EMIT highlightColorC
> }
>
>
> if you call setHighlightCol
> "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).
Well, if a property's default value is set again as value, there will be no change done either.