Fusion style: add indent to groupbox title

Add indent to the title if groupbox alignment is set to Qt::AlignLeft |
Qt::AlignVCenter.

Fixes: QTBUG-121049
Change-Id: I25e2fe4e73b920baf4c678b6b0e758d1da7cf632
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 4725bbb3ee41ced9f97d42d73505b2513ff9c576)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3154bf2a7ba96c8787179f9bba70134cb7477236)
This commit is contained in:
Ghenady Kuznetsov 2024-01-01 20:37:48 +02:00 committed by Qt Cherry-pick Bot
parent 1a643cfda0
commit 3465e2d56c

View File

@ -3455,6 +3455,10 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom
case Qt::AlignRight: case Qt::AlignRight:
rect.moveLeft(option->rect.width() - width); rect.moveLeft(option->rect.width() - width);
break; break;
case Qt::AlignLeft:
if ((groupBoxTextAlignment & Qt::AlignVertical_Mask) == Qt::AlignVCenter)
rect.moveLeft(proxy()->pixelMetric(PM_LayoutLeftMargin, option, widget));
break;
} }
} }