diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2020-06-29 12:03:30 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-06-30 16:00:02 +0000 |
commit | 738145cd6dd033c66ab5db6132a65bb0d826f969 (patch) | |
tree | 8bd566381c0bf31ed2a069cf1c9aaf11fc4dcca8 /src/plugins/styles | |
parent | 3666a66b0c741df75007c84e7e7f0c59e98fa24f (diff) |
QMacStyle - stop using the deprecated API
Namely, -calcSize method of NSControl (we're calling it for NSSlider).
The documentation recommends overriding -layout instead, but we don't
inherit NSSlider thus cannot override anything. Also, he documentation
says that -calcSize call its cell's -calcDrawInfo: if needed.
The default -calcDrawInfo: in NSCell is documented to be a noop and
it would appear NSSliderCell does not override it. Thus we remove
this call.
Change-Id: Ic3e8bf742b50528a0616fb73494ec340fcd57e25
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d81d3d5f9261f885dff5e42bfac3dfad26a86b09)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index d0c97dc11c..06d606f05d 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -5397,7 +5397,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex } else #endif { - [slider calcSize]; if (!hasDoubleTicks) fixStaleGeometry(slider); NSSliderCell *cell = slider.cell; @@ -5782,7 +5781,6 @@ QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc, if (!setupSlider(slider, sl)) break; - [slider calcSize]; NSSliderCell *cell = slider.cell; const auto barRect = QRectF::fromCGRect([cell barRectFlipped:hasTicks]); const auto knobRect = QRectF::fromCGRect([cell knobRectFlipped:NO]); @@ -5887,7 +5885,6 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op if (!setupSlider(slider, sl)) break; - [slider calcSize]; NSSliderCell *cell = slider.cell; if (sc == SC_SliderHandle) { ret = QRectF::fromCGRect([cell knobRectFlipped:NO]).toRect(); |