summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-10-29 15:55:29 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-29 15:38:13 +0100
commita199dd133e15374552c4238b3fd1fb0e83a59988 (patch)
tree77dc1b4b045da4219f4ba7287be16ed3dbfe2b9e /src
parentd7a0d243a984f032a8f838e7b44297eac81ef190 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
1 files changed, 1 insertions, 1 deletions
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 {