diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2020-06-29 12:03:30 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2020-06-30 13:37:26 +0200 |
commit | d81d3d5f9261f885dff5e42bfac3dfad26a86b09 (patch) | |
tree | e9188a600b315c12f7d4d16146f620c3bcffc040 /src/plugins/styles | |
parent | b3146d2bb830ebbd34e59ea50aba4c69bb12cb90 (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.
Pick-to: 5.15
Change-Id: Ic3e8bf742b50528a0616fb73494ec340fcd57e25
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
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 b28eeb7cb5..beeaa14924 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -5384,7 +5384,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex } else #endif { - [slider calcSize]; if (!hasDoubleTicks) fixStaleGeometry(slider); NSSliderCell *cell = slider.cell; @@ -5769,7 +5768,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]); @@ -5874,7 +5872,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(); |