diff options
author | Robert Griebl <robert.griebl@qt.io> | 2020-11-18 14:39:33 +0100 |
---|---|---|
committer | Robert Griebl <robert.griebl@qt.io> | 2020-11-28 17:47:41 +0100 |
commit | 911ee1f92017f22f9aa1fd430b414ff28c7e0cbe (patch) | |
tree | 58ad194c55506ccb7792949914ccec2757d88ad3 /src/common-lib/utilities.h | |
parent | 6f8a53da17c04848319dcb5d58e70f12788ca9d7 (diff) |
Qt 6 port, part 1 .. without cmake
All C++ and QML unit-tests pass.
The QML "windowitem" test is very unstable though and often crashes
in the RHI layer.
Change-Id: Ia42fc71ad69d2ba74b8b631ded7569b48cf458ee
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'src/common-lib/utilities.h')
-rw-r--r-- | src/common-lib/utilities.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common-lib/utilities.h b/src/common-lib/utilities.h index 0d51fc6f..7086be3d 100644 --- a/src/common-lib/utilities.h +++ b/src/common-lib/utilities.h @@ -157,4 +157,10 @@ inline bool loadResource(const QString &resource) : (QResource::registerResource(resource) || QLibrary(QDir().absoluteFilePath(resource)).load()); } +// Qt6 removed v_cast, but the "replacement" QVariant::Private::get is const only +template <typename T> T *qt6_v_cast(QVariant::Private *vp) +{ + return static_cast<T *>(const_cast<void *>(vp->storage())); +} + QT_END_NAMESPACE_AM |