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>
This commit is contained in:
Timur Pocheptsov 2020-06-29 12:03:30 +02:00
parent b3146d2bb8
commit d81d3d5f92

View File

@ -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();