From d81d3d5f9261f885dff5e42bfac3dfad26a86b09 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 29 Jun 2020 12:03:30 +0200 Subject: QMacStyle - stop using the deprecated API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø Reviewed-by: Volker Hilsheimer --- src/plugins/styles/mac/qmacstyle_mac.mm | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/plugins/styles/mac/qmacstyle_mac.mm') 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(); -- cgit v1.2.3