Fix QCommonStyle::subControlRect(SC_GroupBoxCheckBox)

Make sure the groupbox check indicator doesn't get placed in negative
coordinates when font height is smaller than the indicator height.

Task-number: QTBUG-33610
Change-Id: Ifad0016e9311f1212cccb6d5971343beb68517c4
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
This commit is contained in:
J-P Nurmi 2013-10-29 15:55:29 +02:00 committed by The Qt Project
parent d7a0d243a9
commit a199dd133e

View File

@ -4251,7 +4251,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
if (sc == SC_GroupBoxCheckBox) {
int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget);
left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth);
int top = totalRect.top() + (fontMetrics.height() - indicatorHeight) / 2;
int top = totalRect.top() + qMax(0, fontMetrics.height() - indicatorHeight) / 2;
totalRect.setRect(left, top, indicatorWidth, indicatorHeight);
// Adjust for label
} else {