56bd1b76d2 changed the update
resolve mask behavior in QPalette to avoid detaching brush data
when modifying the resolve mask if the brush value is not changed.
But this behavior broke compatibility, it introduced unknown risks, and
we cannot ensure that other code in Qt does not depend on the old
behavior.
We both need to ensure that we don't detach when the value is not
changed, and ensure that the resolveMask is always updated regardless
of whether the value changes, so we need to split them up and
independently share the brush data.
QFont will update its corresponding resolveMask even if the value has
not changed, so it is better to correct this behavior so that QPalette
and QFont are consistent.
[ChangeLog][QtGui][QPalette] Always update resolve mask in
QPalette::setBrush, even if the value of brush has not changed.
Fixes: QTBUG-98762
Pick-to: 6.4 6.3 6.2
Change-Id: Ib845361b30f21c3d78c16ced923c1678b12e05ac
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>