diff options
-rw-r--r-- | src/gui/styles/qcleanlooksstyle.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index 11f4d26..3fb63f2 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -3768,6 +3768,20 @@ QSize QCleanlooksStyle::sizeFromContents(ContentsType type, const QStyleOption * } break; case CT_GroupBox: + // Since we use a bold font we have to recalculate base width + if (const QGroupBox *gb = qobject_cast<const QGroupBox*>(widget)) { + QFont font = gb->font(); + font.setBold(true); + QFontMetrics metrics(font); + int baseWidth = metrics.width(gb->title()) + metrics.width(QLatin1Char(' ')); + if (gb->isCheckable()) { + baseWidth += pixelMetric(QStyle::PM_IndicatorWidth, option, widget); + baseWidth += pixelMetric(QStyle::PM_CheckBoxLabelSpacing, option, widget); + } + newSize.setWidth(qMax(baseWidth, newSize.width())); + } + newSize += QSize(0, 1); + break; case CT_RadioButton: case CT_CheckBox: newSize += QSize(0, 1); |