From a199dd133e15374552c4238b3fd1fb0e83a59988 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 29 Oct 2013 15:55:29 +0200 Subject: [PATCH] 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 --- src/widgets/styles/qcommonstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 7f0813c303..a9f1c3bbbc 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -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 {