Go to file
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
.github/workflows Github Actions: many minor updates 2021-01-22 18:48:54 +01:00
bin CMake: Allow usage of QtStandaloneTestTemplateProject as package component 2021-04-23 13:31:04 +02:00
cmake Warn on any PUBLIC usage requirements specified for Qt plugins 2021-07-12 19:49:13 +02:00
coin Add instructions to collect results from COIN test run 2021-07-01 08:46:57 +00:00
config.tests Fix the precompile_header configure test 2021-06-19 01:08:23 +02:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Doc: Terminate C-comment 2021-06-30 13:36:26 +02:00
examples Android: trim down the examples manifests from obsolete tags 2021-07-01 23:54:15 +03:00
lib
libexec Fix global header exclusion regex 2021-07-09 13:56:18 +02:00
mkspecs Fix qmlimportscanner path for android deployment settings 2021-06-28 18:27:51 +02:00
qmake Fix QT_HOST_DATA for builds setting INSTALL_MKSPECSDIR 2021-06-23 22:12:41 +02:00
src QColorTrcLut: hold in shared_ptr 2021-07-12 22:16:41 +02:00
tests QColorTrcLut: hold in shared_ptr 2021-07-12 22:16:41 +02:00
util cldr.py: Avoid raising StopIteration from generators 2021-07-09 13:42:21 +02:00
.cmake.conf Conan: Read status flag from .cmake.conf 2021-06-21 15:19:16 +03:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore .gitignore: Ignore __pycache__ directories 2021-07-07 19:05:25 +02:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.qmake.conf Bump version 2021-02-18 07:20:21 +02:00
.tag
CMakeLists.txt CMake: Fix global 'apk' target to actually build all apks 2021-06-08 22:37:50 +02:00
conanfile.py Conan: simplify Conan recipe 2021-06-21 15:19:16 +03:00
config_help.txt configure: Note that -linker works also with clang 2021-07-12 14:46:56 +02:00
configure Remove unsupported host-related configure options 2021-07-06 08:53:52 +02:00
configure.bat Remove superfluous variable assignments from configure.bat 2021-03-11 16:39:54 +01:00
configure.cmake The build for INTEGRITY is static only so libdl.a is not needed 2021-07-06 16:56:09 +03:00
dependencies.yaml
LICENSE.FDL
LICENSE.GPL2
LICENSE.GPL3
LICENSE.GPL3-EXCEPT
LICENSE.LGPL3
LICENSE.LGPLv3
LICENSE.QT-LICENSE-AGREEMENT Update enterprise license agreement v4.2.1 2019-12-18 13:07:19 +02:00
qt_cmdline.cmake Remove unsupported host-related configure options 2021-07-06 08:53:52 +02:00
sync.profile Implement generating of a module cpp export header 2021-06-24 20:40:49 +02:00