QCommonStyle: fetch flat
property from style option
The same information is available both from the QGroupBox API and from the QStyleOption; we should prefer the latter, because this makes it easier to use QStyle from QQuick.Controls (where a QGroupBox is not instantiated). Change-Id: I05ed1e3406676bde5d124d395d43caa0961c4f2d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
e56c79dc9d
commit
9ee29b826c
@ -4921,8 +4921,8 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
|
||||
break;
|
||||
#if QT_CONFIG(groupbox)
|
||||
case CT_GroupBox:
|
||||
if (const QGroupBox *grb = static_cast<const QGroupBox *>(widget))
|
||||
sz += QSize(!grb->isFlat() ? 16 : 0, 0);
|
||||
if (const QStyleOptionGroupBox *styleOpt = qstyleoption_cast<const QStyleOptionGroupBox *>(opt))
|
||||
sz += QSize(styleOpt->features.testFlag(QStyleOptionFrame::Flat) ? 0 : 16, 0);
|
||||
break;
|
||||
#endif // QT_CONFIG(groupbox)
|
||||
case CT_MdiControls:
|
||||
|
Loading…
Reference in New Issue
Block a user