diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-01-14 17:50:39 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-01-16 00:01:43 +0100 |
commit | 43ce457cbd093fc06d99b5ac833c789ef7c893d5 (patch) | |
tree | 3cc4e2c5e6df2f1b7877124786e7db38cd90e85f /src/widgets/widgets/qfocusframe.cpp | |
parent | 72ee1df260d728a1e699bd4c6e03bf202c929cbd (diff) |
Widgets: pass widget to QStyle::pixelMetric()
Make sure to pass the widget to QStyle::pixelMetric() as some styles
might use this (e.g. the new windows styles) to determine the correct
pixel metric.
Pick-to: 6.7 6.6 6.5 6.2
Task-number: QTBUG-1857
Change-Id: I5c32f5af8b284749732b610e56b4e3d8c8ed1946
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qfocusframe.cpp')
-rw-r--r-- | src/widgets/widgets/qfocusframe.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/widgets/qfocusframe.cpp b/src/widgets/widgets/qfocusframe.cpp index 396f7fca14..d66faedbac 100644 --- a/src/widgets/widgets/qfocusframe.cpp +++ b/src/widgets/widgets/qfocusframe.cpp @@ -52,8 +52,8 @@ void QFocusFramePrivate::updateSize() QStyleOption opt; q->initStyleOption(&opt); - int vmargin = q->style()->pixelMetric(QStyle::PM_FocusFrameVMargin, &opt), - hmargin = q->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, &opt); + int vmargin = q->style()->pixelMetric(QStyle::PM_FocusFrameVMargin, &opt, q), + hmargin = q->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, &opt, q); QPoint pos(widget->x(), widget->y()); if (q->parentWidget() != widget->parentWidget()) pos = widget->parentWidget()->mapTo(q->parentWidget(), pos); @@ -229,8 +229,8 @@ QFocusFrame::paintEvent(QPaintEvent *) QStylePainter p(this); QStyleOption option; initStyleOption(&option); - const int vmargin = style()->pixelMetric(QStyle::PM_FocusFrameVMargin, &option); - const int hmargin = style()->pixelMetric(QStyle::PM_FocusFrameHMargin, &option); + const int vmargin = style()->pixelMetric(QStyle::PM_FocusFrameVMargin, &option, this); + const int hmargin = style()->pixelMetric(QStyle::PM_FocusFrameHMargin, &option, this); QWidgetPrivate *wd = qt_widget_private(d->widget); QRect rect = wd->clipRect().adjusted(0, 0, hmargin*2, vmargin*2); p.setClipRect(rect); |