diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-20 11:37:41 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-22 10:05:03 +0100 |
commit | 835e18d9ff79867f508fc8baac7fcc5bb4efc0cb (patch) | |
tree | 8e6268c9bf7747f138514dceb5382fafab67ff3e /src/widgets/widgets/qgroupbox.cpp | |
parent | c58ee54a707717b142f6e90cf48302884feb0b12 (diff) |
Fix wrong DPI used by QStyle::pixelMetric()
Pass on the option or the widget in order to ensure usage of the
correct DPI for High DPI scaling.
Task-number: QTBUG-82356
Change-Id: I5df903a83f88adebd143e514e2fead367d39f015
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/widgets/widgets/qgroupbox.cpp')
-rw-r--r-- | src/widgets/widgets/qgroupbox.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp index eec794562a..735e950602 100644 --- a/src/widgets/widgets/qgroupbox.cpp +++ b/src/widgets/widgets/qgroupbox.cpp @@ -491,9 +491,9 @@ QSize QGroupBox::minimumSizeHint() const int baseWidth = metrics.horizontalAdvance(d->title) + metrics.horizontalAdvance(QLatin1Char(' ')); int baseHeight = metrics.height(); if (d->checkable) { - baseWidth += style()->pixelMetric(QStyle::PM_IndicatorWidth); - baseWidth += style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing); - baseHeight = qMax(baseHeight, style()->pixelMetric(QStyle::PM_IndicatorHeight)); + baseWidth += style()->pixelMetric(QStyle::PM_IndicatorWidth, &option); + baseWidth += style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing, &option); + baseHeight = qMax(baseHeight, style()->pixelMetric(QStyle::PM_IndicatorHeight, &option)); } QSize size = style()->sizeFromContents(QStyle::CT_GroupBox, &option, QSize(baseWidth, baseHeight), this); |