diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2013-10-29 15:55:29 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-29 15:38:13 +0100 |
commit | a199dd133e15374552c4238b3fd1fb0e83a59988 (patch) | |
tree | 77dc1b4b045da4219f4ba7287be16ed3dbfe2b9e /src/widgets | |
parent | d7a0d243a984f032a8f838e7b44297eac81ef190 (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/widgets')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 2 |
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 { |