qt5base-lts/tests/auto
Jøger Hansegård 8d367dec15 Add QUniqueHandle - a general purpose RAII wrapper for non-memory types
When interfacing with C-style APIs, such as the Windows API, resources
are often represented using handle objects. Lifetime management of such
resources can be cumbersome and error prone, because typical handle
objects (ints) do not give any help to release resources, and to manage
ownership.

Although std::unique_ptr can be retro-fitted with a custom deleter, and
helps transfer of ownership, it is inherently a pointer type. It can
therefore be clumsy to use with C-style APIs, particularly if the
invalid (uninitialized) handle value is not a nullptr. Also, the
std::unique_ptr does not work well when an allocating function returns
the handle as a pointer argument.

The QUniqueHandle addresses these issues by providing a movable only
value type that is designed as a RAII handle wrapper.

A similar handle wrapper exists in the Windows SDK, as part of the WRL
library. Unfortunately, this is Microsoft specific, and is not supported
by MINGW.

Since the QUniqueHandle is platform independent, it can be used also
with non- Microsoft platforms, and can be useful with other C-style APIs
such as FFmpeg or SQLite.

Pick-to: 6.6 6.5
Change-Id: Ibfc0cec3f361ec004febea5f284ebf75e27c0054
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-15 05:01:51 +01:00
..
bic/data Add binary compatibility file for 6.6.0 2023-10-17 22:23:42 +03:00
cmake CMake: Fix config condition evaluator 2023-09-21 21:46:46 +02:00
concurrent QtConcurrent::run() test: Add tests taking static function 2023-11-09 16:52:44 +00:00
corelib Add QUniqueHandle - a general purpose RAII wrapper for non-memory types 2023-11-15 05:01:51 +01:00
dbus tst_qdbusmarshall: disambiguate unittest data tag names 2023-10-18 20:53:12 +03:00
gui QGuiApplication: check return value of platformTheme::palette() 2023-11-14 20:24:58 +01:00
guiapplauncher Move Weather Anchor Layout example to manual tests 2023-03-02 05:55:57 +01:00
network Use SSL_CTX_set_dh_auto if DHparam is empty 2023-10-25 17:23:13 +02:00
opengl tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
other macOS: Fix tst_MacGui::nonModalOrder() 2023-10-25 17:41:32 +02:00
printsupport Dialogs: clean up native dialogs when object gets destroyed 2023-09-06 23:12:33 +02:00
shared coretext: Support variable application fonts 2023-10-03 19:25:46 +02:00
sql SQLite: Handle identifiers correctly 2023-09-28 20:51:33 +08:00
testlib Increase QTest failure message limit 2023-10-19 10:57:21 +08:00
tools tst_qmakelib: compile with QT_NO_FOREACH 2023-08-19 19:17:17 +03:00
wasm CMake: Make qtbase tests standalone projects 2023-07-05 15:09:32 +02:00
widgets QDial: don't crash when min==max and setting a value != min & max 2023-11-12 23:45:30 +01:00
xml CMake: Make qtbase tests standalone projects 2023-07-05 15:09:32 +02:00
CMakeLists.txt CI: Enable some tests under corelib/thread for Wasm platform 2023-09-14 11:58:48 +02:00
network-settings.h QtNetworkSettings: narrow down hasIPv6 to specific OSes 2023-08-29 07:20:51 -07:00