qt5base-lts/tests/auto/gui/painting
Marc Mutz ff6156204d QColorTrcLut: hold in shared_ptr
... instead of raw pointers or QSharedPointer.

Raw pointers are, of course, a no-no in modern code. In particular,
when the result is then held in shared_ptr or QSharedPointer,
make_shared or QSharedPointer::create() should be used to reduce
number of memory allocations.

Since this is private API, we're free to use std::shared_ptr, which
does only half the atomic operations on copies, compared to
QSharedPointer, so is more efficient.

For either make_shared or QSharedPointer::create(), we need to work
around the private ctor, which we do by inheriting a member-function
local class from QColorTrcLut and make_shared'ing that. As a
member-function-local class, it has access to the otherwise private
parts of QColorTrcLut, including its default constructor. As a public
subclass, shared_ptr has no problem performing the derived-to-base
pointer adjustment in the return statement. This way, we can use
make_shared even though our target's class' ctor is private.

Change-Id: Icb11249b54cd5e544e692f6a0bf1f9dda1710454
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-07-12 22:16:41 +02:00
..
qbrush Fix: QBrush autotest failure on Android and Wayland 2021-03-11 07:03:45 +00:00
qcolor QColorTrcLut: hold in shared_ptr 2021-07-12 22:16:41 +02:00
qcolorspace Improve tst_QColorSpace::imageConversion64PM test 2021-06-16 12:23:41 +02:00
qpagelayout Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpageranges Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpagesize Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpaintengine Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpainter Introduce float QImage formats and rendering 2021-05-26 18:00:01 +02:00
qpainterpath QPainterPath: fix handling of fill rules 2021-03-26 10:45:46 +01:00
qpainterpathstroker Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpathclipper Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpdfwriter Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpen Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpolygon Remove the qmake project files 2021-01-07 15:32:28 +01:00
qregion Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtransform Remove the qmake project files 2021-01-07 15:32:28 +01:00
qwmatrix Get rid of QMatrix 2020-02-28 08:57:57 +01:00
CMakeLists.txt Rename QRangeCollection to QPageRanges, make it a proper value type 2020-11-08 11:49:54 +01:00