FusionStyle: fix QCachedPainter usage for PE_PanelButtonCommand

When using a QCachedPainter we must ensure to paint with topleft at 0/0
which was not the case for PE_PanelButtonCommand.

This amends e70cc743bc89afa7f36cd6afa520af2dab763c3a.

Task-number: QTBUG-129680
Change-Id: I48de1163c675d9bc0d177b57d361a2af4ef5dbda
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
Christian Ehrlicher 2024-11-04 20:26:08 +01:00
parent ad50ca7d9e
commit a4d4d04bbd

View File

@ -775,7 +775,7 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
QCachedPainter p(painter, u"pushbutton-" + buttonColor.name(QColor::HexArgb), option);
if (p.needsPainting()) {
const QRect &rect = option->rect;
const QRect rect = QRect(0, 0, option->rect.width(), option->rect.height());
const QRect r = rect.adjusted(0, 1, -1, 0);
const QColor &darkOutline = (hasFocus | isDefault) ? highlightedOutline : outline;