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:
parent
d7a0d243a9
commit
a199dd133e
@ -4251,7 +4251,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
|||||||
if (sc == SC_GroupBoxCheckBox) {
|
if (sc == SC_GroupBoxCheckBox) {
|
||||||
int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget);
|
int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget);
|
||||||
left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth);
|
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);
|
totalRect.setRect(left, top, indicatorWidth, indicatorHeight);
|
||||||
// Adjust for label
|
// Adjust for label
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user