qt5base-lts/tests/auto/gui
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
..
image Add load/fromdata() overloads taking QByteArrayView to QImage 2021-06-02 23:02:45 +02:00
itemmodels QFileSystemModel fails to locate a host from root's visible children 2021-05-20 15:02:38 +00:00
kernel tests: fix deprecated implicit capture of this via [=] 2021-06-30 23:13:28 +02:00
math3d tst_QMatrixNxN: fix type-punning warning 2021-06-30 23:13:28 +02:00
painting QColorTrcLut: hold in shared_ptr 2021-07-12 22:16:41 +02:00
platform Move QtX11Extras into QtGui as private API 2021-05-10 21:19:46 +00:00
qopengl Block flaky rhi and OpenGL tests on Android 2021-05-30 23:02:53 +02:00
qopenglconfig Remove the qmake project files 2021-01-07 15:32:28 +01:00
qvulkan vulkan: Update legacy tests and examples to the modern validation layer 2021-05-31 17:16:49 +02:00
rhi Prefer QFAIL("Informative message") over QVERIFY(false) 2021-06-14 15:57:16 +02:00
text Avoid overflow in text layout 2021-06-17 09:58:27 +00:00
util QTextureFileData: support key value metadata 2021-02-09 13:39:47 +01:00
CMakeLists.txt Move QtX11Extras into QtGui as private API 2021-05-10 21:19:46 +00:00