summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/global/patches/tlexpected/0006-Namespace-TL_-macros-with-Q23_.patch914
-rw-r--r--src/corelib/global/qexpected_p.h312
-rw-r--r--src/corelib/global/qnumeric.h2
-rw-r--r--src/corelib/kernel/qjniobject.cpp76
-rw-r--r--src/corelib/kernel/qmetaobject.cpp27
-rw-r--r--src/corelib/kernel/qmetaobject_p.h1
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder.cpp55
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder_p.h4
-rw-r--r--src/corelib/kernel/qobjectdefs.h2
-rw-r--r--src/corelib/kernel/qtmocconstants.h3
-rw-r--r--src/corelib/kernel/qtmochelpers.h7
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp16
-rw-r--r--src/corelib/tools/qsize.h4
-rw-r--r--src/dbus/qdbusmetaobject.cpp3
-rw-r--r--src/gui/accessible/qaccessible_base.h4
-rw-r--r--src/gui/kernel/qguiapplication_p.h4
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp32
-rw-r--r--src/gui/math3d/qmatrix4x4.h28
-rw-r--r--src/gui/math3d/qquaternion.h8
-rw-r--r--src/gui/math3d/qvectornd.cpp17
-rw-r--r--src/gui/painting/qdrawhelper.cpp4
-rw-r--r--src/gui/painting/qpagelayout.cpp8
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp6
-rw-r--r--src/gui/rhi/qrhimetal.mm22
-rw-r--r--src/gui/text/freetype/qfontengine_ft.cpp8
-rw-r--r--src/gui/text/freetype/qfontengine_ft_p.h4
-rw-r--r--src/gui/text/qcolrpaintgraphrenderer.cpp2
-rw-r--r--src/gui/text/qfontengine.cpp6
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/windows/qwindowsfontdatabasebase.cpp6
-rw-r--r--src/gui/text/windows/qwindowsfontenginedirectwrite.cpp2
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h2
-rw-r--r--src/network/access/qhttpthreaddelegate_p.h2
-rw-r--r--src/plugins/platforms/wasm/qwasmdrag.cpp18
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.cpp1
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow_p.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp2
-rw-r--r--src/plugins/styles/modernwindows/qwindows11style.cpp2
-rw-r--r--src/tools/moc/generator.cpp31
-rw-r--r--src/tools/moc/generator.h10
-rw-r--r--src/tools/moc/moc.cpp65
-rw-r--r--src/widgets/widgets/qmenu.cpp6
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json3
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json3
-rw-r--r--tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp37
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp100
-rw-r--r--tests/auto/tools/moc/allmocs_baseline_in.json180
-rw-r--r--tests/auto/tools/mochelpers/tst_mochelpers.cpp7
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp22
49 files changed, 1780 insertions, 301 deletions
diff --git a/src/corelib/global/patches/tlexpected/0006-Namespace-TL_-macros-with-Q23_.patch b/src/corelib/global/patches/tlexpected/0006-Namespace-TL_-macros-with-Q23_.patch
new file mode 100644
index 00000000000..f3c45f07594
--- /dev/null
+++ b/src/corelib/global/patches/tlexpected/0006-Namespace-TL_-macros-with-Q23_.patch
@@ -0,0 +1,914 @@
+From 5676e5f83597dc1fb32b551c863633eff102e879 Mon Sep 17 00:00:00 2001
+From: Marc Mutz <[email protected]>
+Date: Thu, 27 Nov 2025 07:51:19 +0100
+Subject: [PATCH] Namespace TL_ macros with Q23_
+
+Change-Id: Ib5762ec8ebe81e0c750da84be29531b7179c5025
+---
+ src/corelib/global/qexpected_p.h | 312 +++++++++++++++----------------
+ 1 file changed, 156 insertions(+), 156 deletions(-)
+
+diff --git a/src/corelib/global/qexpected_p.h b/src/corelib/global/qexpected_p.h
+index 24ea5be1e5e..54bcae51102 100644
+--- a/src/corelib/global/qexpected_p.h
++++ b/src/corelib/global/qexpected_p.h
+@@ -16,8 +16,8 @@
+ // <http://creativecommons.org/publicdomain/zero/1.0/>.
+ ///
+
+-#ifndef TL_EXPECTED_HPP
+-#define TL_EXPECTED_HPP
++#ifndef Q23_TL_EXPECTED_HPP
++#define Q23_TL_EXPECTED_HPP
+
+ //
+ // W A R N I N G
+@@ -30,9 +30,9 @@
+ // We mean it.
+ //
+
+-#define TL_EXPECTED_VERSION_MAJOR 1
+-#define TL_EXPECTED_VERSION_MINOR 1
+-#define TL_EXPECTED_VERSION_PATCH 0
++#define Q23_TL_EXPECTED_VERSION_MAJOR 1
++#define Q23_TL_EXPECTED_VERSION_MINOR 1
++#define Q23_TL_EXPECTED_VERSION_PATCH 0
+
+ #include <QtCore/private/qglobal_p.h>
+ #include <QtCore/qassert.h>
+@@ -44,45 +44,45 @@
+ #include <type_traits>
+ #include <utility>
+
+-#define TL_ASSERT Q_ASSERT
++#define Q23_TL_ASSERT Q_ASSERT
+
+ #if defined(__EXCEPTIONS) || defined(_CPPUNWIND)
+-#define TL_EXPECTED_EXCEPTIONS_ENABLED
++#define Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ #endif
+
+-#if defined(TL_EXPECTED_EXCEPTIONS_ENABLED) && defined(QT_NO_EXCEPTIONS)
+-# undef TL_EXPECTED_EXCEPTIONS_ENABLED
++#if defined(Q23_TL_EXPECTED_EXCEPTIONS_ENABLED) && defined(QT_NO_EXCEPTIONS)
++# undef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ #endif
+
+ #if (defined(_MSC_VER) && _MSC_VER == 1900)
+-#define TL_EXPECTED_MSVC2015
+-#define TL_EXPECTED_MSVC2015_CONSTEXPR
++#define Q23_TL_EXPECTED_MSVC2015
++#define Q23_TL_EXPECTED_MSVC2015_CONSTEXPR
+ #else
+-#define TL_EXPECTED_MSVC2015_CONSTEXPR constexpr
++#define Q23_TL_EXPECTED_MSVC2015_CONSTEXPR constexpr
+ #endif
+
+ #if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \
+ !defined(__clang__))
+-#define TL_EXPECTED_GCC49
++#define Q23_TL_EXPECTED_GCC49
+ #endif
+
+ #if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 4 && \
+ !defined(__clang__))
+-#define TL_EXPECTED_GCC54
++#define Q23_TL_EXPECTED_GCC54
+ #endif
+
+ #if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 5 && \
+ !defined(__clang__))
+-#define TL_EXPECTED_GCC55
++#define Q23_TL_EXPECTED_GCC55
+ #endif
+
+-#if !defined(TL_ASSERT)
++#if !defined(Q23_TL_ASSERT)
+ //can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug
+-#if (TL_CPLUSPLUS > 201103L) && !defined(TL_EXPECTED_GCC49)
++#if (Q23_TL_CPLUSPLUS > 201103L) && !defined(Q23_TL_EXPECTED_GCC49)
+ #include <cassert>
+-#define TL_ASSERT(x) assert(x)
++#define Q23_TL_ASSERT(x) assert(x)
+ #else
+-#define TL_ASSERT(x)
++#define Q23_TL_ASSERT(x)
+ #endif
+ #endif
+
+@@ -90,22 +90,22 @@
+ !defined(__clang__))
+ // GCC < 5 doesn't support overloading on const&& for member functions
+
+-#define TL_EXPECTED_NO_CONSTRR
++#define Q23_TL_EXPECTED_NO_CONSTRR
+ // GCC < 5 doesn't support some standard C++11 type traits
+-#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
++#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
+ std::has_trivial_copy_constructor<T>
+-#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
++#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
+ std::has_trivial_copy_assign<T>
+
+ // This one will be different for GCC 5.7 if it's ever supported
+-#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
++#define Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
+ std::is_trivially_destructible<T>
+
+ // GCC 5 < v < 8 has a bug in is_trivially_copy_constructible which breaks
+ // std::vector for non-copyable types
+ #elif (defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__))
+-#ifndef TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
+-#define TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
++#ifndef Q23_TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
++#define Q23_TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
+ QT_BEGIN_NAMESPACE
+ namespace q23 {
+ namespace detail {
+@@ -121,50 +121,50 @@ struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {};
+ QT_END_NAMESPACE
+ #endif
+
+-#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
++#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
+ q23::detail::is_trivially_copy_constructible<T>
+-#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
++#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
+ std::is_trivially_copy_assignable<T>
+-#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
++#define Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
+ std::is_trivially_destructible<T>
+ #else
+-#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
++#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
+ std::is_trivially_copy_constructible<T>
+-#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
++#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
+ std::is_trivially_copy_assignable<T>
+-#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
++#define Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
+ std::is_trivially_destructible<T>
+ #endif
+
+ #ifdef _MSVC_LANG
+-#define TL_CPLUSPLUS _MSVC_LANG
++#define Q23_TL_CPLUSPLUS _MSVC_LANG
+ #else
+-#define TL_CPLUSPLUS __cplusplus
++#define Q23_TL_CPLUSPLUS __cplusplus
+ #endif
+
+-#if TL_CPLUSPLUS > 201103L
+-#define TL_EXPECTED_CXX14
++#if Q23_TL_CPLUSPLUS > 201103L
++#define Q23_TL_EXPECTED_CXX14
+ #endif
+
+-#ifdef TL_EXPECTED_GCC49
+-#define TL_EXPECTED_GCC49_CONSTEXPR
++#ifdef Q23_TL_EXPECTED_GCC49
++#define Q23_TL_EXPECTED_GCC49_CONSTEXPR
+ #else
+-#define TL_EXPECTED_GCC49_CONSTEXPR constexpr
++#define Q23_TL_EXPECTED_GCC49_CONSTEXPR constexpr
+ #endif
+
+-#if (TL_CPLUSPLUS == 201103L || defined(TL_EXPECTED_MSVC2015) || \
+- defined(TL_EXPECTED_GCC49))
+-#define TL_EXPECTED_11_CONSTEXPR
++#if (Q23_TL_CPLUSPLUS == 201103L || defined(Q23_TL_EXPECTED_MSVC2015) || \
++ defined(Q23_TL_EXPECTED_GCC49))
++#define Q23_TL_EXPECTED_11_CONSTEXPR
+ #else
+-#define TL_EXPECTED_11_CONSTEXPR constexpr
++#define Q23_TL_EXPECTED_11_CONSTEXPR constexpr
+ #endif
+
+ QT_BEGIN_NAMESPACE
+ namespace q23 {
+ template <class T, class E> class expected;
+
+-#ifndef TL_MONOSTATE_INPLACE_MUTEX
+-#define TL_MONOSTATE_INPLACE_MUTEX
++#ifndef Q23_TL_MONOSTATE_INPLACE_MUTEX
++#define Q23_TL_MONOSTATE_INPLACE_MUTEX
+ class monostate {};
+
+ struct in_place_t {
+@@ -196,8 +196,8 @@ public:
+ : m_val(l, std::forward<Args>(args)...) {}
+
+ constexpr const E &error() const & { return m_val; }
+- TL_EXPECTED_11_CONSTEXPR E &error() & { return m_val; }
+- TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move(m_val); }
++ Q23_TL_EXPECTED_11_CONSTEXPR E &error() & { return m_val; }
++ Q23_TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move(m_val); }
+ constexpr const E &&error() const && { return std::move(m_val); }
+
+ private:
+@@ -245,8 +245,8 @@ static constexpr unexpect_t unexpect{};
+
+ namespace detail {
+ template <typename E>
+-[[noreturn]] TL_EXPECTED_11_CONSTEXPR void throw_exception(E &&e) {
+-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
++[[noreturn]] Q23_TL_EXPECTED_11_CONSTEXPR void throw_exception(E &&e) {
++#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ throw std::forward<E>(e);
+ #else
+ (void)e;
+@@ -258,8 +258,8 @@ template <typename E>
+ #endif
+ }
+
+-#ifndef TL_TRAITS_MUTEX
+-#define TL_TRAITS_MUTEX
++#ifndef Q23_TL_TRAITS_MUTEX
++#define Q23_TL_TRAITS_MUTEX
+ // C++14-style aliases for brevity
+ template <class T> using remove_const_t = typename std::remove_const<T>::type;
+ template <class T>
+@@ -278,13 +278,13 @@ struct conjunction<B, Bs...>
+ : std::conditional<bool(B::value), conjunction<Bs...>, B>::type {};
+
+ #if defined(_LIBCPP_VERSION) && __cplusplus == 201103L
+-#define TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
++#define Q23_TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
+ #endif
+
+ // In C++11 mode, there's an issue in libc++'s std::mem_fn
+ // which results in a hard-error when using it in a noexcept expression
+ // in some cases. This is a check to workaround the common failing case.
+-#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
++#ifdef Q23_TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
+ template <class T>
+ struct is_pointer_to_non_const_member_func : std::false_type {};
+ template <class T, class Ret, class... Args>
+@@ -315,7 +315,7 @@ template <class T> struct is_const_or_const_ref<T const> : std::true_type {};
+ // https://stackoverflow.com/questions/38288042/c11-14-invoke-workaround
+ template <
+ typename Fn, typename... Args,
+-#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
++#ifdef Q23_TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
+ typename = enable_if_t<!(is_pointer_to_non_const_member_func<Fn>::value &&
+ is_const_or_const_ref<Args...>::value)>,
+ #endif
+@@ -574,7 +574,7 @@ template <class T, class E> struct expected_storage_base<T, E, true, true> {
+ // T is trivial, E is not.
+ template <class T, class E> struct expected_storage_base<T, E, true, false> {
+ constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {}
+- TL_EXPECTED_MSVC2015_CONSTEXPR expected_storage_base(no_init_t)
++ Q23_TL_EXPECTED_MSVC2015_CONSTEXPR expected_storage_base(no_init_t)
+ : m_no_init(), m_has_val(false) {}
+
+ template <class... Args,
+@@ -675,7 +675,7 @@ template <class E> struct expected_storage_base<void, E, false, true> {
+ #if __GNUC__ <= 5
+ //no constexpr for GCC 4/5 bug
+ #else
+- TL_EXPECTED_MSVC2015_CONSTEXPR
++ Q23_TL_EXPECTED_MSVC2015_CONSTEXPR
+ #endif
+ expected_storage_base() : m_has_val(true) {}
+
+@@ -770,7 +770,7 @@ struct expected_operations_base : expected_storage_base<T, E> {
+ this->m_has_val = false;
+ }
+
+-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
++#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+
+ // These assign overloads ensure that the most efficient assignment
+ // implementation is used while maintaining the strong exception guarantee.
+@@ -820,7 +820,7 @@ struct expected_operations_base : expected_storage_base<T, E> {
+ auto tmp = std::move(geterr());
+ geterr().~unexpected<E>();
+
+-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
++#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ try {
+ construct(rhs.get());
+ } catch (...) {
+@@ -855,7 +855,7 @@ struct expected_operations_base : expected_storage_base<T, E> {
+ if (!this->m_has_val && rhs.m_has_val) {
+ auto tmp = std::move(geterr());
+ geterr().~unexpected<E>();
+-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
++#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ try {
+ construct(std::move(rhs).get());
+ } catch (...) {
+@@ -911,27 +911,27 @@ struct expected_operations_base : expected_storage_base<T, E> {
+
+ bool has_value() const { return this->m_has_val; }
+
+- TL_EXPECTED_11_CONSTEXPR T &get() & { return this->m_val; }
++ Q23_TL_EXPECTED_11_CONSTEXPR T &get() & { return this->m_val; }
+ constexpr const T &get() const & { return this->m_val; }
+- TL_EXPECTED_11_CONSTEXPR T &&get() && { return std::move(this->m_val); }
+-#ifndef TL_EXPECTED_NO_CONSTRR
++ Q23_TL_EXPECTED_11_CONSTEXPR T &&get() && { return std::move(this->m_val); }
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ constexpr const T &&get() const && { return std::move(this->m_val); }
+ #endif
+
+- TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
++ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
+ return this->m_unexpect;
+ }
+ constexpr const unexpected<E> &geterr() const & { return this->m_unexpect; }
+- TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
++ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
+ return std::move(this->m_unexpect);
+ }
+-#ifndef TL_EXPECTED_NO_CONSTRR
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ constexpr const unexpected<E> &&geterr() const && {
+ return std::move(this->m_unexpect);
+ }
+ #endif
+
+- TL_EXPECTED_11_CONSTEXPR void destroy_val() { get().~T(); }
++ Q23_TL_EXPECTED_11_CONSTEXPR void destroy_val() { get().~T(); }
+ };
+
+ // This base class provides some handy member functions which can be used in
+@@ -971,20 +971,20 @@ struct expected_operations_base<void, E> : expected_storage_base<void, E> {
+
+ bool has_value() const { return this->m_has_val; }
+
+- TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
++ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
+ return this->m_unexpect;
+ }
+ constexpr const unexpected<E> &geterr() const & { return this->m_unexpect; }
+- TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
++ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
+ return std::move(this->m_unexpect);
+ }
+-#ifndef TL_EXPECTED_NO_CONSTRR
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ constexpr const unexpected<E> &&geterr() const && {
+ return std::move(this->m_unexpect);
+ }
+ #endif
+
+- TL_EXPECTED_11_CONSTEXPR void destroy_val() {
++ Q23_TL_EXPECTED_11_CONSTEXPR void destroy_val() {
+ // no-op
+ }
+ };
+@@ -992,8 +992,8 @@ struct expected_operations_base<void, E> : expected_storage_base<void, E> {
+ // This class manages conditionally having a trivial copy constructor
+ // This specialization is for when T and E are trivially copy constructible
+ template <class T, class E,
+- bool = is_void_or<T, TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T)>::
+- value &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value,
++ bool = is_void_or<T, Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T)>::
++ value &&Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value,
+ bool = (is_copy_constructible_or_void<T>::value &&
+ std::is_copy_constructible<E>::value)>
+ struct expected_copy_base : expected_operations_base<T, E> {
+@@ -1025,7 +1025,7 @@ struct expected_copy_base<T, E, false, true> : expected_operations_base<T, E> {
+ // doesn't implement an analogue to std::is_trivially_move_constructible. We
+ // have to make do with a non-trivial move constructor even if T is trivially
+ // move constructible
+-#ifndef TL_EXPECTED_GCC49
++#ifndef Q23_TL_EXPECTED_GCC49
+ template <class T, class E,
+ bool = is_void_or<T, std::is_trivially_move_constructible<T>>::value
+ &&std::is_trivially_move_constructible<E>::value>
+@@ -1058,12 +1058,12 @@ struct expected_move_base<T, E, false> : expected_copy_base<T, E> {
+ // This class manages conditionally having a trivial copy assignment operator
+ template <class T, class E,
+ bool = is_void_or<
+- T, conjunction<TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T),
+- TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T),
+- TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T)>>::value
+- &&TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value
+- &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value
+- &&TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value,
++ T, conjunction<Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T),
++ Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T),
++ Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T)>>::value
++ &&Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value
++ &&Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value
++ &&Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value,
+ bool = (is_copy_constructible_or_void<T>::value &&
+ std::is_copy_constructible<E>::value &&
+ is_copy_assignable_or_void<T>::value &&
+@@ -1093,7 +1093,7 @@ struct expected_copy_assign_base<T, E, false, true> : expected_move_base<T, E> {
+ // doesn't implement an analogue to std::is_trivially_move_assignable. We have
+ // to make do with a non-trivial move assignment operator even if T is trivially
+ // move assignable
+-#ifndef TL_EXPECTED_GCC49
++#ifndef Q23_TL_EXPECTED_GCC49
+ template <class T, class E,
+ bool =
+ is_void_or<T, conjunction<std::is_trivially_destructible<T>,
+@@ -1330,10 +1330,10 @@ class expected : private detail::expected_move_assign_base<T, E>,
+
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+- TL_EXPECTED_11_CONSTEXPR U &val() {
++ Q23_TL_EXPECTED_11_CONSTEXPR U &val() {
+ return this->m_val;
+ }
+- TL_EXPECTED_11_CONSTEXPR unexpected<E> &err() { return this->m_unexpect; }
++ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &err() { return this->m_unexpect; }
+
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+@@ -1350,19 +1350,19 @@ public:
+ typedef E error_type;
+ typedef unexpected<E> unexpected_type;
+
+-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
+- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) & {
++#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
++ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) & {
+ return and_then_impl(*this, std::forward<F>(f));
+ }
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && {
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && {
+ return and_then_impl(std::move(*this), std::forward<F>(f));
+ }
+ template <class F> constexpr auto and_then(F &&f) const & {
+ return and_then_impl(*this, std::forward<F>(f));
+ }
+
+-#ifndef TL_EXPECTED_NO_CONSTRR
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ template <class F> constexpr auto and_then(F &&f) const && {
+ return and_then_impl(std::move(*this), std::forward<F>(f));
+ }
+@@ -1370,13 +1370,13 @@ public:
+
+ #else
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR auto
++ Q23_TL_EXPECTED_11_CONSTEXPR auto
+ and_then(F &&f) & -> decltype(and_then_impl(std::declval<expected &>(),
+ std::forward<F>(f))) {
+ return and_then_impl(*this, std::forward<F>(f));
+ }
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR auto
++ Q23_TL_EXPECTED_11_CONSTEXPR auto
+ and_then(F &&f) && -> decltype(and_then_impl(std::declval<expected &&>(),
+ std::forward<F>(f))) {
+ return and_then_impl(std::move(*this), std::forward<F>(f));
+@@ -1387,7 +1387,7 @@ public:
+ return and_then_impl(*this, std::forward<F>(f));
+ }
+
+-#ifndef TL_EXPECTED_NO_CONSTRR
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ template <class F>
+ constexpr auto and_then(F &&f) const && -> decltype(and_then_impl(
+ std::declval<expected const &&>(), std::forward<F>(f))) {
+@@ -1396,12 +1396,12 @@ public:
+ #endif
+ #endif
+
+-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
+- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto map(F &&f) & {
++#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
++ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto map(F &&f) & {
+ return expected_map_impl(*this, std::forward<F>(f));
+ }
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto map(F &&f) && {
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto map(F &&f) && {
+ return expected_map_impl(std::move(*this), std::forward<F>(f));
+ }
+ template <class F> constexpr auto map(F &&f) const & {
+@@ -1412,13 +1412,13 @@ public:
+ }
+ #else
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(
++ Q23_TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(
+ std::declval<expected &>(), std::declval<F &&>()))
+ map(F &&f) & {
+ return expected_map_impl(*this, std::forward<F>(f));
+ }
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(),
++ Q23_TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(),
+ std::declval<F &&>()))
+ map(F &&f) && {
+ return expected_map_impl(std::move(*this), std::forward<F>(f));
+@@ -1430,7 +1430,7 @@ public:
+ return expected_map_impl(*this, std::forward<F>(f));
+ }
+
+-#ifndef TL_EXPECTED_NO_CONSTRR
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ template <class F>
+ constexpr decltype(expected_map_impl(std::declval<const expected &&>(),
+ std::declval<F &&>()))
+@@ -1440,12 +1440,12 @@ public:
+ #endif
+ #endif
+
+-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
+- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) & {
++#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
++ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) & {
+ return expected_map_impl(*this, std::forward<F>(f));
+ }
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) && {
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) && {
+ return expected_map_impl(std::move(*this), std::forward<F>(f));
+ }
+ template <class F> constexpr auto transform(F &&f) const & {
+@@ -1456,13 +1456,13 @@ public:
+ }
+ #else
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(
++ Q23_TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(
+ std::declval<expected &>(), std::declval<F &&>()))
+ transform(F &&f) & {
+ return expected_map_impl(*this, std::forward<F>(f));
+ }
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(),
++ Q23_TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(),
+ std::declval<F &&>()))
+ transform(F &&f) && {
+ return expected_map_impl(std::move(*this), std::forward<F>(f));
+@@ -1474,7 +1474,7 @@ public:
+ return expected_map_impl(*this, std::forward<F>(f));
+ }
+
+-#ifndef TL_EXPECTED_NO_CONSTRR
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ template <class F>
+ constexpr decltype(expected_map_impl(std::declval<const expected &&>(),
+ std::declval<F &&>()))
+@@ -1484,12 +1484,12 @@ public:
+ #endif
+ #endif
+
+-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
+- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) & {
++#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
++ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) & {
+ return map_error_impl(*this, std::forward<F>(f));
+ }
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) && {
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) && {
+ return map_error_impl(std::move(*this), std::forward<F>(f));
+ }
+ template <class F> constexpr auto map_error(F &&f) const & {
+@@ -1500,13 +1500,13 @@ public:
+ }
+ #else
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(),
++ Q23_TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(),
+ std::declval<F &&>()))
+ map_error(F &&f) & {
+ return map_error_impl(*this, std::forward<F>(f));
+ }
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(),
++ Q23_TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(),
+ std::declval<F &&>()))
+ map_error(F &&f) && {
+ return map_error_impl(std::move(*this), std::forward<F>(f));
+@@ -1518,7 +1518,7 @@ public:
+ return map_error_impl(*this, std::forward<F>(f));
+ }
+
+-#ifndef TL_EXPECTED_NO_CONSTRR
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ template <class F>
+ constexpr decltype(map_error_impl(std::declval<const expected &&>(),
+ std::declval<F &&>()))
+@@ -1527,12 +1527,12 @@ public:
+ }
+ #endif
+ #endif
+-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
+- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) & {
++#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
++ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) & {
+ return map_error_impl(*this, std::forward<F>(f));
+ }
+- template <class F> TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) && {
++ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) && {
+ return map_error_impl(std::move(*this), std::forward<F>(f));
+ }
+ template <class F> constexpr auto transform_error(F &&f) const & {
+@@ -1543,13 +1543,13 @@ public:
+ }
+ #else
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(),
++ Q23_TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(),
+ std::declval<F &&>()))
+ transform_error(F &&f) & {
+ return map_error_impl(*this, std::forward<F>(f));
+ }
+ template <class F>
+- TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(),
++ Q23_TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(),
+ std::declval<F &&>()))
+ transform_error(F &&f) && {
+ return map_error_impl(std::move(*this), std::forward<F>(f));
+@@ -1561,7 +1561,7 @@ public:
+ return map_error_impl(*this, std::forward<F>(f));
+ }
+
+-#ifndef TL_EXPECTED_NO_CONSTRR
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ template <class F>
+ constexpr decltype(map_error_impl(std::declval<const expected &&>(),
+ std::declval<F &&>()))
+@@ -1570,11 +1570,11 @@ public:
+ }
+ #endif
+ #endif
+- template <class F> expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) & {
++ template <class F> expected Q23_TL_EXPECTED_11_CONSTEXPR or_else(F &&f) & {
+ return or_else_impl(*this, std::forward<F>(f));
+ }
+
+- template <class F> expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) && {
++ template <class F> expected Q23_TL_EXPECTED_11_CONSTEXPR or_else(F &&f) && {
+ return or_else_impl(std::move(*this), std::forward<F>(f));
+ }
+
+@@ -1582,7 +1582,7 @@ public:
+ return or_else_impl(*this, std::forward<F>(f));
+ }
+
+-#ifndef TL_EXPECTED_NO_CONSTRR
++#ifndef Q23_TL_EXPECTED_NO_CONSTRR
+ template <class F> expected constexpr or_else(F &&f) const && {
+ return or_else_impl(std::move(*this), std::forward<F>(f));
+ }
+@@ -1664,7 +1664,7 @@ public:
+ nullptr,
+ detail::expected_enable_from_other<T, E, U, G, const U &, const G &>
+ * = nullptr>
+- explicit TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
++ explicit Q23_TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
+ : ctor_base(detail::default_constructor_tag{}) {
+ if (rhs.has_value()) {
+ this->construct(*rhs);
+@@ -1679,7 +1679,7 @@ public:
+ nullptr,
+ detail::expected_enable_from_other<T, E, U, G, const U &, const G &>
+ * = nullptr>
+- TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
++ Q23_TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
+ : ctor_base(detail::default_constructor_tag{}) {
+ if (rhs.has_value()) {
+ this->construct(*rhs);
+@@ -1693,7 +1693,7 @@ public:
+ detail::enable_if_t<!(std::is_convertible<U &&, T>::value &&
+ std::is_convertible<G &&, E>::value)> * = nullptr,
+ detail::expected_enable_from_other<T, E, U, G, U &&, G &&> * = nullptr>
+- explicit TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
++ explicit Q23_TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
+ : ctor_base(detail::default_constructor_tag{}) {
+ if (rhs.has_value()) {
+ this->construct(std::move(*rhs));
+@@ -1707,7 +1707,7 @@ public:
+ detail::enable_if_t<(std::is_convertible<U &&, T>::value &&
+ std::is_convertible<G &&, E>::value)> * = nullptr,
+ detail::expected_enable_from_other<T, E, U, G, U &&, G &&> * = nullptr>
+- TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
++ Q23_TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
+ : ctor_base(detail::default_constructor_tag{}) {
+ if (rhs.has_value()) {
+ this->construct(std::move(*rhs));
+@@ -1720,14 +1720,14 @@ public:
+ class U = T,
+ detail::enable_if_t<!std::is_convertible<U &&, T>::value> * = nullptr,
+ detail::expected_enable_forward_value<T, E, U> * = nullptr>
+- explicit TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v)
++ explicit Q23_TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v)
+ : expected(in_place, std::forward<U>(v)) {}
+
+ template <
+ class U = T,
+ detail::enable_if_t<std::is_convertible<U &&, T>::value> * = nullptr,
+ detail::expected_enable_forward_value<T, E, U> * = nullptr>
+- TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v)
++ Q23_TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v)
+ : expected(in_place, std::forward<U>(v)) {}
+
+ template <
+@@ -1773,7 +1773,7 @@ public:
+ auto tmp = std::move(err());
+ err().~unexpected<E>();
+
+-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
++#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ try {
+ ::new (valptr()) T(std::forward<U>(v));
+ this->m_has_val = true;
+@@ -1842,7 +1842,7 @@ public:
+ auto tmp = std::move(err());
+ err().~unexpected<E>();
+
+-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
++#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ try {
+ ::new (valptr()) T(std::forward<Args>(args)...);
+ this->m_has_val = true;
+@@ -1882,7 +1882,7 @@ public:
+ auto tmp = std::move(err());
+ err().~unexpected<E>();
+
+-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
++#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ try {
+ ::new (valptr()) T(il, std::forward<Args>(args)...);
+ this->m_has_val = true;
+@@ -1943,7 +1943,7 @@ private:
+ move_constructing_e_can_throw) {
+ auto temp = std::move(val());
+ val().~T();
+-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
++#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ try {
+ ::new (errptr()) unexpected_type(std::move(rhs.err()));
+ rhs.err().~unexpected_type();
+@@ -1966,7 +1966,7 @@ private:
+ e_is_nothrow_move_constructible) {
+ auto temp = std::move(rhs.err());
+ rhs.err().~unexpected_type();
+-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
++#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
+ try {
+ ::new (rhs.valptr()) T(std::move(val()));
+ val().~T();
+@@ -2008,36 +2008,36 @@ public:
+ }
+
+ constexpr const T *operator->() const {
+- TL_ASSERT(has_value());
++ Q23_TL_ASSERT(has_value());
+ return valptr();
+ }
+- TL_EXPECTED_11_CONSTEXPR T *operator->() {
+- TL_ASSERT(has_value());
++ Q23_TL_EXPECTED_11_CONSTEXPR T *operator->() {
++ Q23_TL_ASSERT(has_value());
+ return valptr();
+ }
+
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+ constexpr const U &operator*() const & {
+- TL_ASSERT(has_value());
++ Q23_TL_ASSERT(has_value());
+ return val();
+ }
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+- TL_EXPECTED_11_CONSTEXPR U &operator*() & {
+- TL_ASSERT(has_value());
++ Q23_TL_EXPECTED_11_CONSTEXPR U &operator*() & {
++ Q23_TL_ASSERT(has_value());
+ return val();
+ }
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+ constexpr const U &&operator*() const && {
+- TL_ASSERT(has_value());
++ Q23_TL_ASSERT(has_value());
+ return std::move(val());
+ }
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+- TL_EXPECTED_11_CONSTEXPR U &&operator*() && {
+- TL_ASSERT(has_value());
++ Q23_TL_EXPECTED_11_CONSTEXPR U &&operator*() && {
++ Q23_TL_ASSERT(has_value());
+ return std::move(val());
+ }
+
+@@ -2046,47 +2046,47 @@ public:
+
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+- TL_EXPECTED_11_CONSTEXPR const U &value() const & {
++ Q23_TL_EXPECTED_11_CONSTEXPR const U &value() const & {
+ if (!has_value())
+ detail::throw_exception(bad_expected_access<E>(err().error()));
+ return val();
+ }
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+- TL_EXPECTED_11_CONSTEXPR U &value() & {
++ Q23_TL_EXPECTED_11_CONSTEXPR U &value() & {
+ if (!has_value())
+ detail::throw_exception(bad_expected_access<E>(err().error()));
+ return val();
+ }
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+- TL_EXPECTED_11_CONSTEXPR const U &&value() const && {
++ Q23_TL_EXPECTED_11_CONSTEXPR const U &&value() const && {
+ if (!has_value())
+ detail::throw_exception(bad_expected_access<E>(std::move(err()).error()));
+ return std::move(val());
+ }
+ template <class U = T,
+ detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
+- TL_EXPECTED_11_CONSTEXPR U &&value() && {
++ Q23_TL_EXPECTED_11_CONSTEXPR U &&value() && {
+ if (!has_value())
+ detail::throw_exception(bad_expected_access<E>(std::move(err()).error()));
+ return std::move(val());
+ }
+
+ constexpr const E &error() const & {
+- TL_ASSERT(!has_value());
++ Q23_TL_ASSERT(!has_value());
+ return err().error();
+ }
+- TL_EXPECTED_11_CONSTEXPR E &error() & {
+- TL_ASSERT(!has_value());
++ Q23_TL_EXPECTED_11_CONSTEXPR E &error() & {
++ Q23_TL_ASSERT(!has_value());
+ return err().error();
+ }
+ constexpr const E &&error() const && {
+- TL_ASSERT(!has_value());
++ Q23_TL_ASSERT(!has_value());
+ return std::move(err().error());
+ }
+- TL_EXPECTED_11_CONSTEXPR E &&error() && {
+- TL_ASSERT(!has_value());
++ Q23_TL_EXPECTED_11_CONSTEXPR E &&error() && {
++ Q23_TL_ASSERT(!has_value());
+ return std::move(err().error());
+ }
+
+@@ -2096,7 +2096,7 @@ public:
+ "T must be copy-constructible and convertible to from U&&");
+ return bool(*this) ? **this : static_cast<T>(std::forward<U>(v));
+ }
+- template <class U> TL_EXPECTED_11_CONSTEXPR T value_or(U &&v) && {
++ template <class U> Q23_TL_EXPECTED_11_CONSTEXPR T value_or(U &&v) && {
+ static_assert(std::is_move_constructible<T>::value &&
+ std::is_convertible<U &&, T>::value,
+ "T must be move-constructible and convertible to from U&&");
+@@ -2109,7 +2109,7 @@ template <class Exp> using exp_t = typename detail::decay_t<Exp>::value_type;
+ template <class Exp> using err_t = typename detail::decay_t<Exp>::error_type;
+ template <class Exp, class Ret> using ret_t = expected<Ret, err_t<Exp>>;
+
+-#ifdef TL_EXPECTED_CXX14
++#ifdef Q23_TL_EXPECTED_CXX14
+ template <class Exp, class F,
+ detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr,
+ class Ret = decltype(detail::invoke(std::declval<F>(),
+@@ -2156,7 +2156,7 @@ constexpr auto and_then_impl(Exp &&exp, F &&f) -> Ret {
+ }
+ #endif
+
+-#ifdef TL_EXPECTED_CXX14
++#ifdef Q23_TL_EXPECTED_CXX14
+ template <class Exp, class F,
+ detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr,
+ class Ret = decltype(detail::invoke(std::declval<F>(),
+@@ -2266,8 +2266,8 @@ auto expected_map_impl(Exp &&exp, F &&f) -> expected<void, err_t<Exp>> {
+ }
+ #endif
+
+-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
+- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
++#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
++ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
+ template <class Exp, class F,
+ detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr,
+ class Ret = decltype(detail::invoke(std::declval<F>(),
+@@ -2382,7 +2382,7 @@ auto map_error_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, monostate> {
+ }
+ #endif
+
+-#ifdef TL_EXPECTED_CXX14
++#ifdef Q23_TL_EXPECTED_CXX14
+ template <class Exp, class F,
+ class Ret = decltype(detail::invoke(std::declval<F>(),
+ std::declval<Exp>().error())),
+--
+2.25.1
+
diff --git a/src/corelib/global/qexpected_p.h b/src/corelib/global/qexpected_p.h
index 24ea5be1e5e..54bcae51102 100644
--- a/src/corelib/global/qexpected_p.h
+++ b/src/corelib/global/qexpected_p.h
@@ -16,8 +16,8 @@
// <http://creativecommons.org/publicdomain/zero/1.0/>.
///
-#ifndef TL_EXPECTED_HPP
-#define TL_EXPECTED_HPP
+#ifndef Q23_TL_EXPECTED_HPP
+#define Q23_TL_EXPECTED_HPP
//
// W A R N I N G
@@ -30,9 +30,9 @@
// We mean it.
//
-#define TL_EXPECTED_VERSION_MAJOR 1
-#define TL_EXPECTED_VERSION_MINOR 1
-#define TL_EXPECTED_VERSION_PATCH 0
+#define Q23_TL_EXPECTED_VERSION_MAJOR 1
+#define Q23_TL_EXPECTED_VERSION_MINOR 1
+#define Q23_TL_EXPECTED_VERSION_PATCH 0
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qassert.h>
@@ -44,45 +44,45 @@
#include <type_traits>
#include <utility>
-#define TL_ASSERT Q_ASSERT
+#define Q23_TL_ASSERT Q_ASSERT
#if defined(__EXCEPTIONS) || defined(_CPPUNWIND)
-#define TL_EXPECTED_EXCEPTIONS_ENABLED
+#define Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
#endif
-#if defined(TL_EXPECTED_EXCEPTIONS_ENABLED) && defined(QT_NO_EXCEPTIONS)
-# undef TL_EXPECTED_EXCEPTIONS_ENABLED
+#if defined(Q23_TL_EXPECTED_EXCEPTIONS_ENABLED) && defined(QT_NO_EXCEPTIONS)
+# undef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
#endif
#if (defined(_MSC_VER) && _MSC_VER == 1900)
-#define TL_EXPECTED_MSVC2015
-#define TL_EXPECTED_MSVC2015_CONSTEXPR
+#define Q23_TL_EXPECTED_MSVC2015
+#define Q23_TL_EXPECTED_MSVC2015_CONSTEXPR
#else
-#define TL_EXPECTED_MSVC2015_CONSTEXPR constexpr
+#define Q23_TL_EXPECTED_MSVC2015_CONSTEXPR constexpr
#endif
#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \
!defined(__clang__))
-#define TL_EXPECTED_GCC49
+#define Q23_TL_EXPECTED_GCC49
#endif
#if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 4 && \
!defined(__clang__))
-#define TL_EXPECTED_GCC54
+#define Q23_TL_EXPECTED_GCC54
#endif
#if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 5 && \
!defined(__clang__))
-#define TL_EXPECTED_GCC55
+#define Q23_TL_EXPECTED_GCC55
#endif
-#if !defined(TL_ASSERT)
+#if !defined(Q23_TL_ASSERT)
//can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug
-#if (TL_CPLUSPLUS > 201103L) && !defined(TL_EXPECTED_GCC49)
+#if (Q23_TL_CPLUSPLUS > 201103L) && !defined(Q23_TL_EXPECTED_GCC49)
#include <cassert>
-#define TL_ASSERT(x) assert(x)
+#define Q23_TL_ASSERT(x) assert(x)
#else
-#define TL_ASSERT(x)
+#define Q23_TL_ASSERT(x)
#endif
#endif
@@ -90,22 +90,22 @@
!defined(__clang__))
// GCC < 5 doesn't support overloading on const&& for member functions
-#define TL_EXPECTED_NO_CONSTRR
+#define Q23_TL_EXPECTED_NO_CONSTRR
// GCC < 5 doesn't support some standard C++11 type traits
-#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
+#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
std::has_trivial_copy_constructor<T>
-#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
+#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
std::has_trivial_copy_assign<T>
// This one will be different for GCC 5.7 if it's ever supported
-#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
+#define Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
std::is_trivially_destructible<T>
// GCC 5 < v < 8 has a bug in is_trivially_copy_constructible which breaks
// std::vector for non-copyable types
#elif (defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__))
-#ifndef TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
-#define TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
+#ifndef Q23_TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
+#define Q23_TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX
QT_BEGIN_NAMESPACE
namespace q23 {
namespace detail {
@@ -121,50 +121,50 @@ struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {};
QT_END_NAMESPACE
#endif
-#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
+#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
q23::detail::is_trivially_copy_constructible<T>
-#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
+#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
std::is_trivially_copy_assignable<T>
-#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
+#define Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
std::is_trivially_destructible<T>
#else
-#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
+#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
std::is_trivially_copy_constructible<T>
-#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
+#define Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
std::is_trivially_copy_assignable<T>
-#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
+#define Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \
std::is_trivially_destructible<T>
#endif
#ifdef _MSVC_LANG
-#define TL_CPLUSPLUS _MSVC_LANG
+#define Q23_TL_CPLUSPLUS _MSVC_LANG
#else
-#define TL_CPLUSPLUS __cplusplus
+#define Q23_TL_CPLUSPLUS __cplusplus
#endif
-#if TL_CPLUSPLUS > 201103L
-#define TL_EXPECTED_CXX14
+#if Q23_TL_CPLUSPLUS > 201103L
+#define Q23_TL_EXPECTED_CXX14
#endif
-#ifdef TL_EXPECTED_GCC49
-#define TL_EXPECTED_GCC49_CONSTEXPR
+#ifdef Q23_TL_EXPECTED_GCC49
+#define Q23_TL_EXPECTED_GCC49_CONSTEXPR
#else
-#define TL_EXPECTED_GCC49_CONSTEXPR constexpr
+#define Q23_TL_EXPECTED_GCC49_CONSTEXPR constexpr
#endif
-#if (TL_CPLUSPLUS == 201103L || defined(TL_EXPECTED_MSVC2015) || \
- defined(TL_EXPECTED_GCC49))
-#define TL_EXPECTED_11_CONSTEXPR
+#if (Q23_TL_CPLUSPLUS == 201103L || defined(Q23_TL_EXPECTED_MSVC2015) || \
+ defined(Q23_TL_EXPECTED_GCC49))
+#define Q23_TL_EXPECTED_11_CONSTEXPR
#else
-#define TL_EXPECTED_11_CONSTEXPR constexpr
+#define Q23_TL_EXPECTED_11_CONSTEXPR constexpr
#endif
QT_BEGIN_NAMESPACE
namespace q23 {
template <class T, class E> class expected;
-#ifndef TL_MONOSTATE_INPLACE_MUTEX
-#define TL_MONOSTATE_INPLACE_MUTEX
+#ifndef Q23_TL_MONOSTATE_INPLACE_MUTEX
+#define Q23_TL_MONOSTATE_INPLACE_MUTEX
class monostate {};
struct in_place_t {
@@ -196,8 +196,8 @@ public:
: m_val(l, std::forward<Args>(args)...) {}
constexpr const E &error() const & { return m_val; }
- TL_EXPECTED_11_CONSTEXPR E &error() & { return m_val; }
- TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move(m_val); }
+ Q23_TL_EXPECTED_11_CONSTEXPR E &error() & { return m_val; }
+ Q23_TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move(m_val); }
constexpr const E &&error() const && { return std::move(m_val); }
private:
@@ -245,8 +245,8 @@ static constexpr unexpect_t unexpect{};
namespace detail {
template <typename E>
-[[noreturn]] TL_EXPECTED_11_CONSTEXPR void throw_exception(E &&e) {
-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
+[[noreturn]] Q23_TL_EXPECTED_11_CONSTEXPR void throw_exception(E &&e) {
+#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
throw std::forward<E>(e);
#else
(void)e;
@@ -258,8 +258,8 @@ template <typename E>
#endif
}
-#ifndef TL_TRAITS_MUTEX
-#define TL_TRAITS_MUTEX
+#ifndef Q23_TL_TRAITS_MUTEX
+#define Q23_TL_TRAITS_MUTEX
// C++14-style aliases for brevity
template <class T> using remove_const_t = typename std::remove_const<T>::type;
template <class T>
@@ -278,13 +278,13 @@ struct conjunction<B, Bs...>
: std::conditional<bool(B::value), conjunction<Bs...>, B>::type {};
#if defined(_LIBCPP_VERSION) && __cplusplus == 201103L
-#define TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
+#define Q23_TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
#endif
// In C++11 mode, there's an issue in libc++'s std::mem_fn
// which results in a hard-error when using it in a noexcept expression
// in some cases. This is a check to workaround the common failing case.
-#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
+#ifdef Q23_TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
template <class T>
struct is_pointer_to_non_const_member_func : std::false_type {};
template <class T, class Ret, class... Args>
@@ -315,7 +315,7 @@ template <class T> struct is_const_or_const_ref<T const> : std::true_type {};
// https://stackoverflow.com/questions/38288042/c11-14-invoke-workaround
template <
typename Fn, typename... Args,
-#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
+#ifdef Q23_TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
typename = enable_if_t<!(is_pointer_to_non_const_member_func<Fn>::value &&
is_const_or_const_ref<Args...>::value)>,
#endif
@@ -574,7 +574,7 @@ template <class T, class E> struct expected_storage_base<T, E, true, true> {
// T is trivial, E is not.
template <class T, class E> struct expected_storage_base<T, E, true, false> {
constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {}
- TL_EXPECTED_MSVC2015_CONSTEXPR expected_storage_base(no_init_t)
+ Q23_TL_EXPECTED_MSVC2015_CONSTEXPR expected_storage_base(no_init_t)
: m_no_init(), m_has_val(false) {}
template <class... Args,
@@ -675,7 +675,7 @@ template <class E> struct expected_storage_base<void, E, false, true> {
#if __GNUC__ <= 5
//no constexpr for GCC 4/5 bug
#else
- TL_EXPECTED_MSVC2015_CONSTEXPR
+ Q23_TL_EXPECTED_MSVC2015_CONSTEXPR
#endif
expected_storage_base() : m_has_val(true) {}
@@ -770,7 +770,7 @@ struct expected_operations_base : expected_storage_base<T, E> {
this->m_has_val = false;
}
-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
+#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
// These assign overloads ensure that the most efficient assignment
// implementation is used while maintaining the strong exception guarantee.
@@ -820,7 +820,7 @@ struct expected_operations_base : expected_storage_base<T, E> {
auto tmp = std::move(geterr());
geterr().~unexpected<E>();
-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
+#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
try {
construct(rhs.get());
} catch (...) {
@@ -855,7 +855,7 @@ struct expected_operations_base : expected_storage_base<T, E> {
if (!this->m_has_val && rhs.m_has_val) {
auto tmp = std::move(geterr());
geterr().~unexpected<E>();
-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
+#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
try {
construct(std::move(rhs).get());
} catch (...) {
@@ -911,27 +911,27 @@ struct expected_operations_base : expected_storage_base<T, E> {
bool has_value() const { return this->m_has_val; }
- TL_EXPECTED_11_CONSTEXPR T &get() & { return this->m_val; }
+ Q23_TL_EXPECTED_11_CONSTEXPR T &get() & { return this->m_val; }
constexpr const T &get() const & { return this->m_val; }
- TL_EXPECTED_11_CONSTEXPR T &&get() && { return std::move(this->m_val); }
-#ifndef TL_EXPECTED_NO_CONSTRR
+ Q23_TL_EXPECTED_11_CONSTEXPR T &&get() && { return std::move(this->m_val); }
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
constexpr const T &&get() const && { return std::move(this->m_val); }
#endif
- TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
+ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
return this->m_unexpect;
}
constexpr const unexpected<E> &geterr() const & { return this->m_unexpect; }
- TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
+ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
return std::move(this->m_unexpect);
}
-#ifndef TL_EXPECTED_NO_CONSTRR
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
constexpr const unexpected<E> &&geterr() const && {
return std::move(this->m_unexpect);
}
#endif
- TL_EXPECTED_11_CONSTEXPR void destroy_val() { get().~T(); }
+ Q23_TL_EXPECTED_11_CONSTEXPR void destroy_val() { get().~T(); }
};
// This base class provides some handy member functions which can be used in
@@ -971,20 +971,20 @@ struct expected_operations_base<void, E> : expected_storage_base<void, E> {
bool has_value() const { return this->m_has_val; }
- TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
+ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
return this->m_unexpect;
}
constexpr const unexpected<E> &geterr() const & { return this->m_unexpect; }
- TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
+ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
return std::move(this->m_unexpect);
}
-#ifndef TL_EXPECTED_NO_CONSTRR
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
constexpr const unexpected<E> &&geterr() const && {
return std::move(this->m_unexpect);
}
#endif
- TL_EXPECTED_11_CONSTEXPR void destroy_val() {
+ Q23_TL_EXPECTED_11_CONSTEXPR void destroy_val() {
// no-op
}
};
@@ -992,8 +992,8 @@ struct expected_operations_base<void, E> : expected_storage_base<void, E> {
// This class manages conditionally having a trivial copy constructor
// This specialization is for when T and E are trivially copy constructible
template <class T, class E,
- bool = is_void_or<T, TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T)>::
- value &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value,
+ bool = is_void_or<T, Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T)>::
+ value &&Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value,
bool = (is_copy_constructible_or_void<T>::value &&
std::is_copy_constructible<E>::value)>
struct expected_copy_base : expected_operations_base<T, E> {
@@ -1025,7 +1025,7 @@ struct expected_copy_base<T, E, false, true> : expected_operations_base<T, E> {
// doesn't implement an analogue to std::is_trivially_move_constructible. We
// have to make do with a non-trivial move constructor even if T is trivially
// move constructible
-#ifndef TL_EXPECTED_GCC49
+#ifndef Q23_TL_EXPECTED_GCC49
template <class T, class E,
bool = is_void_or<T, std::is_trivially_move_constructible<T>>::value
&&std::is_trivially_move_constructible<E>::value>
@@ -1058,12 +1058,12 @@ struct expected_move_base<T, E, false> : expected_copy_base<T, E> {
// This class manages conditionally having a trivial copy assignment operator
template <class T, class E,
bool = is_void_or<
- T, conjunction<TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T),
- TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T),
- TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T)>>::value
- &&TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value
- &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value
- &&TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value,
+ T, conjunction<Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T),
+ Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T),
+ Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T)>>::value
+ &&Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value
+ &&Q23_TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value
+ &&Q23_TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value,
bool = (is_copy_constructible_or_void<T>::value &&
std::is_copy_constructible<E>::value &&
is_copy_assignable_or_void<T>::value &&
@@ -1093,7 +1093,7 @@ struct expected_copy_assign_base<T, E, false, true> : expected_move_base<T, E> {
// doesn't implement an analogue to std::is_trivially_move_assignable. We have
// to make do with a non-trivial move assignment operator even if T is trivially
// move assignable
-#ifndef TL_EXPECTED_GCC49
+#ifndef Q23_TL_EXPECTED_GCC49
template <class T, class E,
bool =
is_void_or<T, conjunction<std::is_trivially_destructible<T>,
@@ -1330,10 +1330,10 @@ class expected : private detail::expected_move_assign_base<T, E>,
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
- TL_EXPECTED_11_CONSTEXPR U &val() {
+ Q23_TL_EXPECTED_11_CONSTEXPR U &val() {
return this->m_val;
}
- TL_EXPECTED_11_CONSTEXPR unexpected<E> &err() { return this->m_unexpect; }
+ Q23_TL_EXPECTED_11_CONSTEXPR unexpected<E> &err() { return this->m_unexpect; }
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
@@ -1350,19 +1350,19 @@ public:
typedef E error_type;
typedef unexpected<E> unexpected_type;
-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
- template <class F> TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) & {
+#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
+ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) & {
return and_then_impl(*this, std::forward<F>(f));
}
- template <class F> TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && {
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && {
return and_then_impl(std::move(*this), std::forward<F>(f));
}
template <class F> constexpr auto and_then(F &&f) const & {
return and_then_impl(*this, std::forward<F>(f));
}
-#ifndef TL_EXPECTED_NO_CONSTRR
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
template <class F> constexpr auto and_then(F &&f) const && {
return and_then_impl(std::move(*this), std::forward<F>(f));
}
@@ -1370,13 +1370,13 @@ public:
#else
template <class F>
- TL_EXPECTED_11_CONSTEXPR auto
+ Q23_TL_EXPECTED_11_CONSTEXPR auto
and_then(F &&f) & -> decltype(and_then_impl(std::declval<expected &>(),
std::forward<F>(f))) {
return and_then_impl(*this, std::forward<F>(f));
}
template <class F>
- TL_EXPECTED_11_CONSTEXPR auto
+ Q23_TL_EXPECTED_11_CONSTEXPR auto
and_then(F &&f) && -> decltype(and_then_impl(std::declval<expected &&>(),
std::forward<F>(f))) {
return and_then_impl(std::move(*this), std::forward<F>(f));
@@ -1387,7 +1387,7 @@ public:
return and_then_impl(*this, std::forward<F>(f));
}
-#ifndef TL_EXPECTED_NO_CONSTRR
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
template <class F>
constexpr auto and_then(F &&f) const && -> decltype(and_then_impl(
std::declval<expected const &&>(), std::forward<F>(f))) {
@@ -1396,12 +1396,12 @@ public:
#endif
#endif
-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
- template <class F> TL_EXPECTED_11_CONSTEXPR auto map(F &&f) & {
+#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
+ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto map(F &&f) & {
return expected_map_impl(*this, std::forward<F>(f));
}
- template <class F> TL_EXPECTED_11_CONSTEXPR auto map(F &&f) && {
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto map(F &&f) && {
return expected_map_impl(std::move(*this), std::forward<F>(f));
}
template <class F> constexpr auto map(F &&f) const & {
@@ -1412,13 +1412,13 @@ public:
}
#else
template <class F>
- TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(
+ Q23_TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(
std::declval<expected &>(), std::declval<F &&>()))
map(F &&f) & {
return expected_map_impl(*this, std::forward<F>(f));
}
template <class F>
- TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(),
+ Q23_TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(),
std::declval<F &&>()))
map(F &&f) && {
return expected_map_impl(std::move(*this), std::forward<F>(f));
@@ -1430,7 +1430,7 @@ public:
return expected_map_impl(*this, std::forward<F>(f));
}
-#ifndef TL_EXPECTED_NO_CONSTRR
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
template <class F>
constexpr decltype(expected_map_impl(std::declval<const expected &&>(),
std::declval<F &&>()))
@@ -1440,12 +1440,12 @@ public:
#endif
#endif
-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
- template <class F> TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) & {
+#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
+ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) & {
return expected_map_impl(*this, std::forward<F>(f));
}
- template <class F> TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) && {
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) && {
return expected_map_impl(std::move(*this), std::forward<F>(f));
}
template <class F> constexpr auto transform(F &&f) const & {
@@ -1456,13 +1456,13 @@ public:
}
#else
template <class F>
- TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(
+ Q23_TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(
std::declval<expected &>(), std::declval<F &&>()))
transform(F &&f) & {
return expected_map_impl(*this, std::forward<F>(f));
}
template <class F>
- TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(),
+ Q23_TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(),
std::declval<F &&>()))
transform(F &&f) && {
return expected_map_impl(std::move(*this), std::forward<F>(f));
@@ -1474,7 +1474,7 @@ public:
return expected_map_impl(*this, std::forward<F>(f));
}
-#ifndef TL_EXPECTED_NO_CONSTRR
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
template <class F>
constexpr decltype(expected_map_impl(std::declval<const expected &&>(),
std::declval<F &&>()))
@@ -1484,12 +1484,12 @@ public:
#endif
#endif
-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
- template <class F> TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) & {
+#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
+ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) & {
return map_error_impl(*this, std::forward<F>(f));
}
- template <class F> TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) && {
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) && {
return map_error_impl(std::move(*this), std::forward<F>(f));
}
template <class F> constexpr auto map_error(F &&f) const & {
@@ -1500,13 +1500,13 @@ public:
}
#else
template <class F>
- TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(),
+ Q23_TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(),
std::declval<F &&>()))
map_error(F &&f) & {
return map_error_impl(*this, std::forward<F>(f));
}
template <class F>
- TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(),
+ Q23_TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(),
std::declval<F &&>()))
map_error(F &&f) && {
return map_error_impl(std::move(*this), std::forward<F>(f));
@@ -1518,7 +1518,7 @@ public:
return map_error_impl(*this, std::forward<F>(f));
}
-#ifndef TL_EXPECTED_NO_CONSTRR
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
template <class F>
constexpr decltype(map_error_impl(std::declval<const expected &&>(),
std::declval<F &&>()))
@@ -1527,12 +1527,12 @@ public:
}
#endif
#endif
-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
- template <class F> TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) & {
+#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
+ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) & {
return map_error_impl(*this, std::forward<F>(f));
}
- template <class F> TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) && {
+ template <class F> Q23_TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) && {
return map_error_impl(std::move(*this), std::forward<F>(f));
}
template <class F> constexpr auto transform_error(F &&f) const & {
@@ -1543,13 +1543,13 @@ public:
}
#else
template <class F>
- TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(),
+ Q23_TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(),
std::declval<F &&>()))
transform_error(F &&f) & {
return map_error_impl(*this, std::forward<F>(f));
}
template <class F>
- TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(),
+ Q23_TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(),
std::declval<F &&>()))
transform_error(F &&f) && {
return map_error_impl(std::move(*this), std::forward<F>(f));
@@ -1561,7 +1561,7 @@ public:
return map_error_impl(*this, std::forward<F>(f));
}
-#ifndef TL_EXPECTED_NO_CONSTRR
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
template <class F>
constexpr decltype(map_error_impl(std::declval<const expected &&>(),
std::declval<F &&>()))
@@ -1570,11 +1570,11 @@ public:
}
#endif
#endif
- template <class F> expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) & {
+ template <class F> expected Q23_TL_EXPECTED_11_CONSTEXPR or_else(F &&f) & {
return or_else_impl(*this, std::forward<F>(f));
}
- template <class F> expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) && {
+ template <class F> expected Q23_TL_EXPECTED_11_CONSTEXPR or_else(F &&f) && {
return or_else_impl(std::move(*this), std::forward<F>(f));
}
@@ -1582,7 +1582,7 @@ public:
return or_else_impl(*this, std::forward<F>(f));
}
-#ifndef TL_EXPECTED_NO_CONSTRR
+#ifndef Q23_TL_EXPECTED_NO_CONSTRR
template <class F> expected constexpr or_else(F &&f) const && {
return or_else_impl(std::move(*this), std::forward<F>(f));
}
@@ -1664,7 +1664,7 @@ public:
nullptr,
detail::expected_enable_from_other<T, E, U, G, const U &, const G &>
* = nullptr>
- explicit TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
+ explicit Q23_TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
: ctor_base(detail::default_constructor_tag{}) {
if (rhs.has_value()) {
this->construct(*rhs);
@@ -1679,7 +1679,7 @@ public:
nullptr,
detail::expected_enable_from_other<T, E, U, G, const U &, const G &>
* = nullptr>
- TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
+ Q23_TL_EXPECTED_11_CONSTEXPR expected(const expected<U, G> &rhs)
: ctor_base(detail::default_constructor_tag{}) {
if (rhs.has_value()) {
this->construct(*rhs);
@@ -1693,7 +1693,7 @@ public:
detail::enable_if_t<!(std::is_convertible<U &&, T>::value &&
std::is_convertible<G &&, E>::value)> * = nullptr,
detail::expected_enable_from_other<T, E, U, G, U &&, G &&> * = nullptr>
- explicit TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
+ explicit Q23_TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
: ctor_base(detail::default_constructor_tag{}) {
if (rhs.has_value()) {
this->construct(std::move(*rhs));
@@ -1707,7 +1707,7 @@ public:
detail::enable_if_t<(std::is_convertible<U &&, T>::value &&
std::is_convertible<G &&, E>::value)> * = nullptr,
detail::expected_enable_from_other<T, E, U, G, U &&, G &&> * = nullptr>
- TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
+ Q23_TL_EXPECTED_11_CONSTEXPR expected(expected<U, G> &&rhs)
: ctor_base(detail::default_constructor_tag{}) {
if (rhs.has_value()) {
this->construct(std::move(*rhs));
@@ -1720,14 +1720,14 @@ public:
class U = T,
detail::enable_if_t<!std::is_convertible<U &&, T>::value> * = nullptr,
detail::expected_enable_forward_value<T, E, U> * = nullptr>
- explicit TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v)
+ explicit Q23_TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v)
: expected(in_place, std::forward<U>(v)) {}
template <
class U = T,
detail::enable_if_t<std::is_convertible<U &&, T>::value> * = nullptr,
detail::expected_enable_forward_value<T, E, U> * = nullptr>
- TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v)
+ Q23_TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v)
: expected(in_place, std::forward<U>(v)) {}
template <
@@ -1773,7 +1773,7 @@ public:
auto tmp = std::move(err());
err().~unexpected<E>();
-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
+#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
try {
::new (valptr()) T(std::forward<U>(v));
this->m_has_val = true;
@@ -1842,7 +1842,7 @@ public:
auto tmp = std::move(err());
err().~unexpected<E>();
-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
+#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
try {
::new (valptr()) T(std::forward<Args>(args)...);
this->m_has_val = true;
@@ -1882,7 +1882,7 @@ public:
auto tmp = std::move(err());
err().~unexpected<E>();
-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
+#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
try {
::new (valptr()) T(il, std::forward<Args>(args)...);
this->m_has_val = true;
@@ -1943,7 +1943,7 @@ private:
move_constructing_e_can_throw) {
auto temp = std::move(val());
val().~T();
-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
+#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
try {
::new (errptr()) unexpected_type(std::move(rhs.err()));
rhs.err().~unexpected_type();
@@ -1966,7 +1966,7 @@ private:
e_is_nothrow_move_constructible) {
auto temp = std::move(rhs.err());
rhs.err().~unexpected_type();
-#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
+#ifdef Q23_TL_EXPECTED_EXCEPTIONS_ENABLED
try {
::new (rhs.valptr()) T(std::move(val()));
val().~T();
@@ -2008,36 +2008,36 @@ public:
}
constexpr const T *operator->() const {
- TL_ASSERT(has_value());
+ Q23_TL_ASSERT(has_value());
return valptr();
}
- TL_EXPECTED_11_CONSTEXPR T *operator->() {
- TL_ASSERT(has_value());
+ Q23_TL_EXPECTED_11_CONSTEXPR T *operator->() {
+ Q23_TL_ASSERT(has_value());
return valptr();
}
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
constexpr const U &operator*() const & {
- TL_ASSERT(has_value());
+ Q23_TL_ASSERT(has_value());
return val();
}
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
- TL_EXPECTED_11_CONSTEXPR U &operator*() & {
- TL_ASSERT(has_value());
+ Q23_TL_EXPECTED_11_CONSTEXPR U &operator*() & {
+ Q23_TL_ASSERT(has_value());
return val();
}
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
constexpr const U &&operator*() const && {
- TL_ASSERT(has_value());
+ Q23_TL_ASSERT(has_value());
return std::move(val());
}
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
- TL_EXPECTED_11_CONSTEXPR U &&operator*() && {
- TL_ASSERT(has_value());
+ Q23_TL_EXPECTED_11_CONSTEXPR U &&operator*() && {
+ Q23_TL_ASSERT(has_value());
return std::move(val());
}
@@ -2046,47 +2046,47 @@ public:
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
- TL_EXPECTED_11_CONSTEXPR const U &value() const & {
+ Q23_TL_EXPECTED_11_CONSTEXPR const U &value() const & {
if (!has_value())
detail::throw_exception(bad_expected_access<E>(err().error()));
return val();
}
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
- TL_EXPECTED_11_CONSTEXPR U &value() & {
+ Q23_TL_EXPECTED_11_CONSTEXPR U &value() & {
if (!has_value())
detail::throw_exception(bad_expected_access<E>(err().error()));
return val();
}
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
- TL_EXPECTED_11_CONSTEXPR const U &&value() const && {
+ Q23_TL_EXPECTED_11_CONSTEXPR const U &&value() const && {
if (!has_value())
detail::throw_exception(bad_expected_access<E>(std::move(err()).error()));
return std::move(val());
}
template <class U = T,
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
- TL_EXPECTED_11_CONSTEXPR U &&value() && {
+ Q23_TL_EXPECTED_11_CONSTEXPR U &&value() && {
if (!has_value())
detail::throw_exception(bad_expected_access<E>(std::move(err()).error()));
return std::move(val());
}
constexpr const E &error() const & {
- TL_ASSERT(!has_value());
+ Q23_TL_ASSERT(!has_value());
return err().error();
}
- TL_EXPECTED_11_CONSTEXPR E &error() & {
- TL_ASSERT(!has_value());
+ Q23_TL_EXPECTED_11_CONSTEXPR E &error() & {
+ Q23_TL_ASSERT(!has_value());
return err().error();
}
constexpr const E &&error() const && {
- TL_ASSERT(!has_value());
+ Q23_TL_ASSERT(!has_value());
return std::move(err().error());
}
- TL_EXPECTED_11_CONSTEXPR E &&error() && {
- TL_ASSERT(!has_value());
+ Q23_TL_EXPECTED_11_CONSTEXPR E &&error() && {
+ Q23_TL_ASSERT(!has_value());
return std::move(err().error());
}
@@ -2096,7 +2096,7 @@ public:
"T must be copy-constructible and convertible to from U&&");
return bool(*this) ? **this : static_cast<T>(std::forward<U>(v));
}
- template <class U> TL_EXPECTED_11_CONSTEXPR T value_or(U &&v) && {
+ template <class U> Q23_TL_EXPECTED_11_CONSTEXPR T value_or(U &&v) && {
static_assert(std::is_move_constructible<T>::value &&
std::is_convertible<U &&, T>::value,
"T must be move-constructible and convertible to from U&&");
@@ -2109,7 +2109,7 @@ template <class Exp> using exp_t = typename detail::decay_t<Exp>::value_type;
template <class Exp> using err_t = typename detail::decay_t<Exp>::error_type;
template <class Exp, class Ret> using ret_t = expected<Ret, err_t<Exp>>;
-#ifdef TL_EXPECTED_CXX14
+#ifdef Q23_TL_EXPECTED_CXX14
template <class Exp, class F,
detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr,
class Ret = decltype(detail::invoke(std::declval<F>(),
@@ -2156,7 +2156,7 @@ constexpr auto and_then_impl(Exp &&exp, F &&f) -> Ret {
}
#endif
-#ifdef TL_EXPECTED_CXX14
+#ifdef Q23_TL_EXPECTED_CXX14
template <class Exp, class F,
detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr,
class Ret = decltype(detail::invoke(std::declval<F>(),
@@ -2266,8 +2266,8 @@ auto expected_map_impl(Exp &&exp, F &&f) -> expected<void, err_t<Exp>> {
}
#endif
-#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
- !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
+#if defined(Q23_TL_EXPECTED_CXX14) && !defined(Q23_TL_EXPECTED_GCC49) && \
+ !defined(Q23_TL_EXPECTED_GCC54) && !defined(Q23_TL_EXPECTED_GCC55)
template <class Exp, class F,
detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr,
class Ret = decltype(detail::invoke(std::declval<F>(),
@@ -2382,7 +2382,7 @@ auto map_error_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, monostate> {
}
#endif
-#ifdef TL_EXPECTED_CXX14
+#ifdef Q23_TL_EXPECTED_CXX14
template <class Exp, class F,
class Ret = decltype(detail::invoke(std::declval<F>(),
std::declval<Exp>().error())),
diff --git a/src/corelib/global/qnumeric.h b/src/corelib/global/qnumeric.h
index 4568d089590..db32ae73556 100644
--- a/src/corelib/global/qnumeric.h
+++ b/src/corelib/global/qnumeric.h
@@ -641,7 +641,7 @@ template <typename T, typename S>
[[nodiscard]] constexpr bool fuzzyCompare(const T &lhs, const S &rhs) noexcept
{
static_assert(noexcept(qIsNull(lhs) && qIsNull(rhs) && qFuzzyIsNull(lhs - rhs) && qFuzzyCompare(lhs, rhs)),
- "The operations qIsNull(), qFuzzyIsNull() and qFuzzyCompare() must be noexcept"
+ "The operations qIsNull(), qFuzzyIsNull() and qFuzzyCompare() must be noexcept "
"for both argument types!");
return qIsNull(lhs) || qIsNull(rhs) ? qFuzzyIsNull(lhs - rhs) : qFuzzyCompare(lhs, rhs);
}
diff --git a/src/corelib/kernel/qjniobject.cpp b/src/corelib/kernel/qjniobject.cpp
index abef9fdd663..21bfe5af448 100644
--- a/src/corelib/kernel/qjniobject.cpp
+++ b/src/corelib/kernel/qjniobject.cpp
@@ -27,7 +27,8 @@ using namespace Qt::StringLiterals;
garbage-collected and providing access to most \c JNIEnv method calls
(member, static) and fields (setter, getter). It eliminates much
boiler-plate that would normally be needed, with direct JNI access, for
- every operation, including exception-handling.
+ every operation. Exceptions thrown by called Java methods are cleared by
+ default, but can since Qt 6.11 also be handled by the caller.
\note This API has been designed and tested for use with Android.
It has not been tested for other platforms.
@@ -129,12 +130,46 @@ using namespace Qt::StringLiterals;
Note that while the first template parameter specifies the return type of the Java
function, the method will still return a QJniObject.
- \section1 Handling Java Exception
+ \section1 Handling Java Exceptions
After calling Java functions that might throw exceptions, it is important
to check for, handle and clear out any exception before continuing. All
- QJniObject functions handle exceptions internally by reporting and clearing them,
- saving client code the need to handle exceptions.
+ QJniObject functions can handle exceptions internally by reporting and
+ clearing them. This includes JNI exceptions, for instance when trying to
+ call a method that doesn't exist, or with bad parameters; and exceptions
+ are thrown by the method as a way of reporting errors or returning failure
+ information.
+
+ From Qt 6.11 on, client code can opt in to handle exceptions explicitly in
+ each call. To do so, use \c{std::expected} from C++ 23 as the return type,
+ with the value type as the expected, and \c{jthrowable} as the error type.
+ For instance, trying to read a setting value via the
+ \c{android.provider.Settings.Secure} type might throw an exception if the
+ setting does not exist.
+
+ \code
+ Q_DECLARE_JNI_CLASS(SettingsSecure, "android/provider/Settings$Secure")
+ using namespace QtJniTypes;
+
+ QString enabledInputMethods()
+ {
+ ContentResolver resolver;
+ SettingsSecure settings;
+
+ auto defaultInputMethods = settings.callMethod<std::expected<QString, jthrowable>>(
+ "getString", resolver, u"enabled_input_methods"_s
+ );
+ if (defaultInputMethods)
+ return defaultInputMethods.value();
+ QStringList stackTrace = QJniEnvironment::stackTrace(defaultInputMethods.error());
+ }
+ \endcode
+
+ You can use any other type that behaves like \c{std::expected}, so handling
+ exceptions explicitly is possible without using C++23. The only
+ requirements are that the type declares three nested types \c{value_type},
+ \c{error_type}, and \c{unexpected_type}, can be constructed from the value
+ type, and from its \c{unexpected_type} holding a \c{jthrowable}.
\note The user must handle exceptions manually when doing JNI calls using \c JNIEnv directly.
It is unsafe to make other JNI calls when exceptions are pending. For more information, see
@@ -921,7 +956,10 @@ QByteArray QJniObject::className() const
jint size = myJavaString.callMethod<jint>("length");
\endcode
- The method signature is deduced at compile time from \c Ret and the types of \a args.
+ The method signature is deduced at compile time from \c Ret and the types
+ of \a args. \c Ret can be a \c{std::expected}-compatible type that returns
+ a value, or \l{Handling Java Exceptions}{any Java exception thrown} by the
+ called method.
*/
/*!
@@ -952,7 +990,10 @@ QByteArray QJniObject::className() const
jint value = QJniObject::callStaticMethod<jint>("MyClass", "staticMethod");
\endcode
- The method signature is deduced at compile time from \c Ret and the types of \a args.
+ The method signature is deduced at compile time from \c Ret and the types
+ of \a args. \c Ret can be a \c{std::expected}-compatible type that returns
+ a value, or \l{Handling Java Exceptions}{any Java exception thrown} by the
+ called method.
*/
/*!
@@ -1009,7 +1050,10 @@ QByteArray QJniObject::className() const
jdouble randNr = QJniObject::callStaticMethod<jdouble>(javaMathClass, "random");
\endcode
- The method signature is deduced at compile time from \c Ret and the types of \a args.
+ The method signature is deduced at compile time from \c Ret and the types
+ of \a args. \c Ret can be a \c{std::expected}-compatible type that returns
+ a value, or \l{Handling Java Exceptions}{any Java exception thrown} by the
+ called method.
*/
/*!
@@ -1020,8 +1064,12 @@ QByteArray QJniObject::className() const
\c Ret (unless \c Ret is \c void). If \c Ret is a jobject type, then the returned value will
be a QJniObject.
- The method signature is deduced at compile time from \c Ret and the types of \a args.
- \c Klass needs to be a C++ type with a registered type mapping to a Java type.
+ The method signature is deduced at compile time from \c Ret and the types
+ of \a args. \c Klass needs to be a C++ type with a registered type mapping
+ to a Java type. \c Ret can be a \c{std::expected}-compatible type that
+ returns a value, or \l{Handling Java Exceptions}{any Java exception thrown}
+ by the called method.
+
*/
/*!
@@ -1150,7 +1198,10 @@ QJniObject QJniObject::callStaticObjectMethod(jclass clazz, jmethodID methodId,
QJniObject myJavaString2 = myJavaString1.callObjectMethod<jstring>("toString");
\endcode
- The method signature is deduced at compile time from \c Ret and the types of \a args.
+ The method signature is deduced at compile time from \c Ret and the types
+ of \a args. \c Ret can be a \c{std::expected}-compatible type that returns
+ a value, or \l{Handling Java Exceptions}{any Java exception thrown} by the
+ called method.
*/
/*!
@@ -1164,7 +1215,10 @@ QJniObject QJniObject::callStaticObjectMethod(jclass clazz, jmethodID methodId,
QJniObject string = QJniObject::callStaticObjectMethod<jstring>("CustomClass", "getClassName");
\endcode
- The method signature is deduced at compile time from \c Ret and the types of \a args.
+ The method signature is deduced at compile time from \c Ret and the types
+ of \a args. \c Ret can be a \c{std::expected}-compatible type that returns
+ a value, or \l{Handling Java Exceptions}{any Java exception thrown} by the
+ called method.
*/
/*!
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 24cc58829c8..c7e50788b45 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -469,6 +469,33 @@ QMetaType QMetaObject::metaType() const
}
}
+static inline QByteArrayView objectMetaObjectHash(const QMetaObject *m)
+{
+ // metaObjectHash didn't exist before revision 14
+ if (QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && priv(m->d.data)->revision < 14)
+ return {};
+ const auto index = priv(m->d.data)->metaObjectHashIndex;
+ if (index == -1)
+ return {};
+ return stringDataView(m, index);
+}
+
+/*!
+ \since 6.11
+
+ Returns the revisioned hash of the contents of this QMetaObject or nullptr.
+
+ The hash has the following format <hash_revision>$<hash_b64>, where
+ hash_revision is an integer and hash_b64 is the base64 encoding of the
+ hash.
+
+ Note that only hashes of the same revision should be compared.
+*/
+const char *QMetaObject::metaObjectHash() const
+{
+ return objectMetaObjectHash(this).constData();
+}
+
/*!
Returns the method offset for this class; i.e. the index position
of this class's first member function.
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index bfda30fda28..7264d2a956f 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -124,6 +124,7 @@ struct QMetaObjectPrivate
int constructorCount, constructorData;
int flags;
int signalCount;
+ int metaObjectHashIndex;
static inline const QMetaObjectPrivate *get(const QMetaObject *metaobject)
{ return reinterpret_cast<const QMetaObjectPrivate*>(metaobject->d.data); }
diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp
index 6065bf2baea..9af6de73680 100644
--- a/src/corelib/kernel/qmetaobjectbuilder.cpp
+++ b/src/corelib/kernel/qmetaobjectbuilder.cpp
@@ -558,6 +558,8 @@ QMetaPropertyBuilder QMetaObjectBuilder::addProperty(const QMetaProperty &protot
property.setEnumOrFlag(prototype.isEnumType());
property.setConstant(prototype.isConstant());
property.setFinal(prototype.isFinal());
+ property.setVirtual(prototype.isVirtual());
+ property.setOverride(prototype.isOverride());
property.setRevision(prototype.revision());
if (prototype.hasNotifySignal()) {
// Find an existing method for the notify signal, or add a new one.
@@ -1177,10 +1179,11 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
int methodParametersDataSize = aggregateParameterCount(d->methods)
+ aggregateParameterCount(d->constructors);
if constexpr (mode == Construct) {
- static_assert(QMetaObjectPrivate::OutputRevision == 13, "QMetaObjectBuilder should generate the same version as moc");
+ static_assert(QMetaObjectPrivate::OutputRevision == 14, "QMetaObjectBuilder should generate the same version as moc");
pmeta->revision = QMetaObjectPrivate::OutputRevision;
pmeta->flags = d->flags.toInt() | AllocatedMetaObject;
pmeta->className = 0; // Class name is always the first string.
+ pmeta->metaObjectHashIndex = -1; // TODO support hash in the builder too
//pmeta->signalCount is handled in the "output method loop" as an optimization.
pmeta->classInfoCount = d->classInfoNames.size();
@@ -2068,6 +2071,32 @@ bool QMetaPropertyBuilder::isFinal() const
}
/*!
+ Returns \c true if the property is virtual; otherwise returns \c false.
+ The default value is false.
+*/
+bool QMetaPropertyBuilder::isVirtual() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Virtual);
+ else
+ return false;
+}
+
+/*!
+ Returns \c true if the property does override; otherwise returns \c false.
+ The default value is false.
+*/
+bool QMetaPropertyBuilder::isOverride() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Override);
+ else
+ return false;
+}
+
+/*!
* Returns \c true if the property is an alias.
* The default value is false
*/
@@ -2239,6 +2268,30 @@ void QMetaPropertyBuilder::setFinal(bool value)
}
/*!
+ Sets the \c VIRTUAL flag on this property to \a value.
+
+ \sa isFinal()
+*/
+void QMetaPropertyBuilder::setVirtual(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Virtual, value);
+}
+
+/*!
+ Sets the \c OVERRIDE flag on this property to \a value.
+
+ \sa isOverride()
+*/
+void QMetaPropertyBuilder::setOverride(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Override, value);
+}
+
+/*!
Sets the \c ALIAS flag on this property to \a value
*/
void QMetaPropertyBuilder::setAlias(bool value)
diff --git a/src/corelib/kernel/qmetaobjectbuilder_p.h b/src/corelib/kernel/qmetaobjectbuilder_p.h
index 563704d60e6..9591944602a 100644
--- a/src/corelib/kernel/qmetaobjectbuilder_p.h
+++ b/src/corelib/kernel/qmetaobjectbuilder_p.h
@@ -214,6 +214,8 @@ public:
bool isEnumOrFlag() const;
bool isConstant() const;
bool isFinal() const;
+ bool isVirtual() const;
+ bool isOverride() const;
bool isAlias() const;
bool isBindable() const;
bool isRequired() const;
@@ -229,6 +231,8 @@ public:
void setEnumOrFlag(bool value);
void setConstant(bool value);
void setFinal(bool value);
+ void setVirtual(bool value);
+ void setOverride(bool value);
void setAlias(bool value);
void setBindable(bool value);
void setRequired(bool value);
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 848102cc57a..d3e761982f5 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -247,6 +247,8 @@ struct Q_CORE_EXPORT QMetaObject
QMetaType metaType() const;
+ const char *metaObjectHash() const;
+
int methodOffset() const;
int enumeratorOffset() const;
int propertyOffset() const;
diff --git a/src/corelib/kernel/qtmocconstants.h b/src/corelib/kernel/qtmocconstants.h
index 260ac2fa5f8..822e02e6c8e 100644
--- a/src/corelib/kernel/qtmocconstants.h
+++ b/src/corelib/kernel/qtmocconstants.h
@@ -30,7 +30,8 @@ namespace QtMocConstants {
// revision 11 is Qt 6.5: The metatype for void is stored in the metatypes array
// revision 12 is Qt 6.6: It adds the metatype for enums
// revision 13 is Qt 6.9: Adds support for 64-bit QFlags and moves the method revision
-enum { OutputRevision = 13 }; // Used by moc, qmetaobjectbuilder and qdbus
+// revision 14 is Qt 6.11: Adds a hash of meta object contents
+enum { OutputRevision = 14 }; // Used by moc, qmetaobjectbuilder and qdbus
enum PropertyFlags : uint {
Invalid = 0x00000000,
diff --git a/src/corelib/kernel/qtmochelpers.h b/src/corelib/kernel/qtmochelpers.h
index 4c549e78ad5..3d2b59d2a73 100644
--- a/src/corelib/kernel/qtmochelpers.h
+++ b/src/corelib/kernel/qtmochelpers.h
@@ -511,7 +511,8 @@ template <typename ObjectType, typename Unique, typename Strings,
typename Constructors = UintData<>, typename ClassInfo = detail::UintDataBlock<0, 0>>
constexpr auto metaObjectData(uint flags, const Strings &strings,
const Methods &methods, const Properties &properties,
- const Enums &enums, const Constructors &constructors = {},
+ const Enums &enums, int qt_metaObjectHashIndex = -1,
+ const Constructors &constructors = {},
const ClassInfo &classInfo = {})
{
constexpr uint MetaTypeCount = Properties::metaTypeCount()
@@ -520,7 +521,7 @@ constexpr auto metaObjectData(uint flags, const Strings &strings,
+ Methods::metaTypeCount()
+ Constructors::metaTypeCount();
- constexpr uint HeaderSize = 14;
+ constexpr uint HeaderSize = 15;
constexpr uint TotalSize = HeaderSize
+ Properties::dataSize()
+ Enums::dataSize()
@@ -582,6 +583,8 @@ constexpr auto metaObjectData(uint flags, const Strings &strings,
}
}
+ data[14] = qt_metaObjectHashIndex;
+
return result;
}
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 9c26de94b6d..ecd1ac77779 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -517,13 +517,15 @@ QMimeBinaryProvider::loadMimeTypeExtra(const QString &mimeName)
// load comment and globPatterns
// shared-mime-info since 1.3 lowercases the xml files
- QString mimeFile = m_directory + u'/' + mimeName.toLower() + ".xml"_L1;
- if (!QFile::exists(mimeFile))
- mimeFile = m_directory + u'/' + mimeName + ".xml"_L1; // pre-1.3
-
- QFile qfile(mimeFile);
- if (!qfile.open(QFile::ReadOnly))
- return it;
+ QFile qfile;
+ const QString mimeFile = m_directory + u'/' + mimeName.toLower() + ".xml"_L1;
+ qfile.setFileName(mimeFile);
+ if (!qfile.open(QFile::ReadOnly)) {
+ const QString fallbackMimeFile = m_directory + u'/' + mimeName + ".xml"_L1; // pre-1.3
+ qfile.setFileName(fallbackMimeFile);
+ if (!qfile.open(QFile::ReadOnly))
+ return it;
+ }
MimeTypeExtra &extra = it->second;
QString mainPattern;
diff --git a/src/corelib/tools/qsize.h b/src/corelib/tools/qsize.h
index 1c5b02ed1f0..680bf2812d3 100644
--- a/src/corelib/tools/qsize.h
+++ b/src/corelib/tools/qsize.h
@@ -254,15 +254,11 @@ public:
inline QSizeF &operator/=(qreal c);
private:
- QT_WARNING_PUSH
- QT_WARNING_DISABLE_FLOAT_COMPARE
friend constexpr bool qFuzzyCompare(const QSizeF &s1, const QSizeF &s2) noexcept
{
- // if one of the arguments is 0.0.
return QtPrivate::fuzzyCompare(s1.wd, s2.wd)
&& QtPrivate::fuzzyCompare(s1.ht, s2.ht);
}
- QT_WARNING_POP
friend constexpr bool qFuzzyIsNull(const QSizeF &size) noexcept
{ return qFuzzyIsNull(size.wd) && qFuzzyIsNull(size.ht); }
friend constexpr bool comparesEqual(const QSizeF &lhs, const QSizeF &rhs) noexcept
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp
index 149392f9c3c..a4ffd7a64dd 100644
--- a/src/dbus/qdbusmetaobject.cpp
+++ b/src/dbus/qdbusmetaobject.cpp
@@ -383,9 +383,10 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
- methods.size(); // ditto
QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(idata.data());
- static_assert(QMetaObjectPrivate::OutputRevision == 13, "QtDBus meta-object generator should generate the same version as moc");
+ static_assert(QMetaObjectPrivate::OutputRevision == 14, "QtDBus meta-object generator should generate the same version as moc");
header->revision = QMetaObjectPrivate::OutputRevision;
header->className = 0;
+ header->metaObjectHashIndex = -1; // TODO support hash in dbus metaobject too
header->classInfoCount = 0;
header->classInfoData = 0;
header->methodCount = int(signals_.size() + methods.size());
diff --git a/src/gui/accessible/qaccessible_base.h b/src/gui/accessible/qaccessible_base.h
index 3881c6346a0..04efeddf06f 100644
--- a/src/gui/accessible/qaccessible_base.h
+++ b/src/gui/accessible/qaccessible_base.h
@@ -175,11 +175,15 @@ public:
// quint64 alertMedium : 1;
// quint64 alertHigh : 1;
+ Q_DECL_UNUSED_MEMBER quint64 qt_reserved : 27;
+
State() {
std::memset(this, 0, sizeof(State));
}
friend inline bool operator==(const QAccessible::State &first, const QAccessible::State &second)
{
+ static_assert(std::has_unique_object_representations_v<State>,
+ "memcmp() cannot be used on types with padding");
return std::memcmp(&first, &second, sizeof(QAccessible::State)) == 0;
}
};
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index cb4702b5f7e..633ae7895ba 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -228,8 +228,8 @@ public:
// to use single-point precision.
friend constexpr bool operator==(const QLastCursorPosition &p1, const QPointF &p2) noexcept
{
- return qFuzzyCompare(float(p1.x()), float(p2.x()))
- && qFuzzyCompare(float(p1.y()), float(p2.y()));
+ return QtPrivate::fuzzyCompare(float(p1.x()), float(p2.x()))
+ && QtPrivate::fuzzyCompare(float(p1.y()), float(p2.y()));
}
friend constexpr bool operator!=(const QLastCursorPosition &p1, const QPointF &p2) noexcept
{
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index f6a06fd47ca..95b9524172f 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -738,22 +738,22 @@ QMatrix4x4 operator/(const QMatrix4x4& matrix, float divisor)
*/
bool qFuzzyCompare(const QMatrix4x4& m1, const QMatrix4x4& m2) noexcept
{
- return qFuzzyCompare(m1.m[0][0], m2.m[0][0]) &&
- qFuzzyCompare(m1.m[0][1], m2.m[0][1]) &&
- qFuzzyCompare(m1.m[0][2], m2.m[0][2]) &&
- qFuzzyCompare(m1.m[0][3], m2.m[0][3]) &&
- qFuzzyCompare(m1.m[1][0], m2.m[1][0]) &&
- qFuzzyCompare(m1.m[1][1], m2.m[1][1]) &&
- qFuzzyCompare(m1.m[1][2], m2.m[1][2]) &&
- qFuzzyCompare(m1.m[1][3], m2.m[1][3]) &&
- qFuzzyCompare(m1.m[2][0], m2.m[2][0]) &&
- qFuzzyCompare(m1.m[2][1], m2.m[2][1]) &&
- qFuzzyCompare(m1.m[2][2], m2.m[2][2]) &&
- qFuzzyCompare(m1.m[2][3], m2.m[2][3]) &&
- qFuzzyCompare(m1.m[3][0], m2.m[3][0]) &&
- qFuzzyCompare(m1.m[3][1], m2.m[3][1]) &&
- qFuzzyCompare(m1.m[3][2], m2.m[3][2]) &&
- qFuzzyCompare(m1.m[3][3], m2.m[3][3]);
+ return QtPrivate::fuzzyCompare(m1.m[0][0], m2.m[0][0])
+ && QtPrivate::fuzzyCompare(m1.m[0][1], m2.m[0][1])
+ && QtPrivate::fuzzyCompare(m1.m[0][2], m2.m[0][2])
+ && QtPrivate::fuzzyCompare(m1.m[0][3], m2.m[0][3])
+ && QtPrivate::fuzzyCompare(m1.m[1][0], m2.m[1][0])
+ && QtPrivate::fuzzyCompare(m1.m[1][1], m2.m[1][1])
+ && QtPrivate::fuzzyCompare(m1.m[1][2], m2.m[1][2])
+ && QtPrivate::fuzzyCompare(m1.m[1][3], m2.m[1][3])
+ && QtPrivate::fuzzyCompare(m1.m[2][0], m2.m[2][0])
+ && QtPrivate::fuzzyCompare(m1.m[2][1], m2.m[2][1])
+ && QtPrivate::fuzzyCompare(m1.m[2][2], m2.m[2][2])
+ && QtPrivate::fuzzyCompare(m1.m[2][3], m2.m[2][3])
+ && QtPrivate::fuzzyCompare(m1.m[3][0], m2.m[3][0])
+ && QtPrivate::fuzzyCompare(m1.m[3][1], m2.m[3][1])
+ && QtPrivate::fuzzyCompare(m1.m[3][2], m2.m[3][2])
+ && QtPrivate::fuzzyCompare(m1.m[3][3], m2.m[3][3]);
}
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index 2ba274d4517..94f9c12f19b 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -610,14 +610,26 @@ inline QMatrix4x4 operator*(const QMatrix4x4& m1, const QMatrix4x4& m2)
{
QMatrix4x4::Flags flagBits = m1.flagBits | m2.flagBits;
if (flagBits.toInt() < QMatrix4x4::Rotation2D) {
- QMatrix4x4 m = m1;
- m.m[3][0] += m.m[0][0] * m2.m[3][0];
- m.m[3][1] += m.m[1][1] * m2.m[3][1];
- m.m[3][2] += m.m[2][2] * m2.m[3][2];
-
- m.m[0][0] *= m2.m[0][0];
- m.m[1][1] *= m2.m[1][1];
- m.m[2][2] *= m2.m[2][2];
+ QMatrix4x4 m(Qt::Uninitialized);
+ m.m[0][0] = m1.m[0][0] * m2.m[0][0];
+ m.m[0][1] = 0.0f;
+ m.m[0][2] = 0.0f;
+ m.m[0][3] = 0.0f;
+
+ m.m[1][0] = 0.0f;
+ m.m[1][1] = m1.m[1][1] * m2.m[1][1];
+ m.m[1][2] = 0.0f;
+ m.m[1][3] = 0.0f;
+
+ m.m[2][0] = 0.0f;
+ m.m[2][1] = 0.0f;
+ m.m[2][2] = m1.m[2][2] * m2.m[2][2];
+ m.m[2][3] = 0.0f;
+
+ m.m[3][0] = m1.m[3][0] + m1.m[0][0] * m2.m[3][0];
+ m.m[3][1] = m1.m[3][1] + m1.m[1][1] * m2.m[3][1];
+ m.m[3][2] = m1.m[3][2] + m1.m[2][2] * m2.m[3][2];
+ m.m[3][3] = 1.0f;
m.flagBits = flagBits;
return m;
}
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h
index a7b1d432df7..c92e7177199 100644
--- a/src/gui/math3d/qquaternion.h
+++ b/src/gui/math3d/qquaternion.h
@@ -305,10 +305,10 @@ constexpr QQuaternion operator/(const QQuaternion &quaternion, float divisor)
constexpr bool qFuzzyCompare(const QQuaternion &q1, const QQuaternion &q2) noexcept
{
- return qFuzzyCompare(q1.wp, q2.wp) &&
- qFuzzyCompare(q1.xp, q2.xp) &&
- qFuzzyCompare(q1.yp, q2.yp) &&
- qFuzzyCompare(q1.zp, q2.zp);
+ return QtPrivate::fuzzyCompare(q1.wp, q2.wp)
+ && QtPrivate::fuzzyCompare(q1.xp, q2.xp)
+ && QtPrivate::fuzzyCompare(q1.yp, q2.yp)
+ && QtPrivate::fuzzyCompare(q1.zp, q2.zp);
}
#if QT_GUI_INLINE_IMPL_SINCE(6, 11)
diff --git a/src/gui/math3d/qvectornd.cpp b/src/gui/math3d/qvectornd.cpp
index ec836cfa56e..ee070b2b5be 100644
--- a/src/gui/math3d/qvectornd.cpp
+++ b/src/gui/math3d/qvectornd.cpp
@@ -375,7 +375,8 @@ QT_BEGIN_NAMESPACE
*/
bool qFuzzyCompare(QVector2D v1, QVector2D v2) noexcept
{
- return qFuzzyCompare(v1.v[0], v2.v[0]) && qFuzzyCompare(v1.v[1], v2.v[1]);
+ return QtPrivate::fuzzyCompare(v1.v[0], v2.v[0])
+ && QtPrivate::fuzzyCompare(v1.v[1], v2.v[1]);
}
#ifndef QT_NO_VECTOR3D
@@ -979,9 +980,9 @@ QVector3D QVector3D::unproject(const QMatrix4x4 &modelView, const QMatrix4x4 &pr
*/
bool qFuzzyCompare(QVector3D v1, QVector3D v2) noexcept
{
- return qFuzzyCompare(v1.v[0], v2.v[0]) &&
- qFuzzyCompare(v1.v[1], v2.v[1]) &&
- qFuzzyCompare(v1.v[2], v2.v[2]);
+ return QtPrivate::fuzzyCompare(v1.v[0], v2.v[0])
+ && QtPrivate::fuzzyCompare(v1.v[1], v2.v[1])
+ && QtPrivate::fuzzyCompare(v1.v[2], v2.v[2]);
}
#ifndef QT_NO_VECTOR2D
@@ -1501,10 +1502,10 @@ QDataStream &operator>>(QDataStream &stream, QVector3D &vector)
*/
bool qFuzzyCompare(QVector4D v1, QVector4D v2) noexcept
{
- return qFuzzyCompare(v1.v[0], v2.v[0]) &&
- qFuzzyCompare(v1.v[1], v2.v[1]) &&
- qFuzzyCompare(v1.v[2], v2.v[2]) &&
- qFuzzyCompare(v1.v[3], v2.v[3]);
+ return QtPrivate::fuzzyCompare(v1.v[0], v2.v[0])
+ && QtPrivate::fuzzyCompare(v1.v[1], v2.v[1])
+ && QtPrivate::fuzzyCompare(v1.v[2], v2.v[2])
+ && QtPrivate::fuzzyCompare(v1.v[3], v2.v[3]);
}
#ifndef QT_NO_VECTOR2D
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 04433c7703a..697ede42d92 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -930,7 +930,7 @@ static inline bool canUseFastMatrixPath(const qreal cx, const qreal cy, const qs
minc = std::min(minc, std::min(fx, fy));
maxc = std::max(maxc, std::max(fx, fy));
- return minc >= std::numeric_limits<int>::min() && maxc <= std::numeric_limits<int>::max();
+ return minc >= std::numeric_limits<int>::min() && maxc <= qreal(std::numeric_limits<int>::max());
}
template<TextureBlendType blendType, QPixelLayout::BPP bpp, typename T>
@@ -5179,7 +5179,7 @@ static inline bool calculate_fixed_gradient_factors(int count, const QT_FT_Span
const int gss = GRADIENT_STOPTABLE_SIZE - 1;
qreal ryinc = linear.dy * data->m22 * gss * FIXPT_SIZE;
qreal roff = (linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss * FIXPT_SIZE;
- const int limit = std::numeric_limits<int>::max() - FIXPT_SIZE;
+ const qreal limit = qreal(std::numeric_limits<int>::max() - FIXPT_SIZE);
if (count && (std::fabs(ryinc) < limit) && (std::fabs(roff) < limit)
&& (std::fabs(ryinc * spans->y + roff) < limit)
&& (std::fabs(ryinc * (spans + count - 1)->y + roff) < limit)) {
diff --git a/src/gui/painting/qpagelayout.cpp b/src/gui/painting/qpagelayout.cpp
index e6f346dcdf2..17fb6491b75 100644
--- a/src/gui/painting/qpagelayout.cpp
+++ b/src/gui/painting/qpagelayout.cpp
@@ -606,7 +606,7 @@ bool QPageLayout::setLeftMargin(qreal leftMargin, OutOfBoundsPolicy outOfBoundsP
if (d->m_mode == StandardMode && outOfBoundsPolicy == OutOfBoundsPolicy::Clamp)
leftMargin = qBound(d->m_minMargins.left(), leftMargin, d->m_maxMargins.left());
- if (qFuzzyCompare(leftMargin, d->m_margins.left()))
+ if (QtPrivate::fuzzyCompare(leftMargin, d->m_margins.left()))
return true;
if (d->m_mode == FullPageMode
@@ -637,7 +637,7 @@ bool QPageLayout::setRightMargin(qreal rightMargin, OutOfBoundsPolicy outOfBound
if (d->m_mode == StandardMode && outOfBoundsPolicy == OutOfBoundsPolicy::Clamp)
rightMargin = qBound(d->m_minMargins.right(), rightMargin, d->m_maxMargins.right());
- if (qFuzzyCompare(rightMargin, d->m_margins.right()))
+ if (QtPrivate::fuzzyCompare(rightMargin, d->m_margins.right()))
return true;
if (d->m_mode == FullPageMode
@@ -668,7 +668,7 @@ bool QPageLayout::setTopMargin(qreal topMargin, OutOfBoundsPolicy outOfBoundsPol
if (d->m_mode == StandardMode && outOfBoundsPolicy == OutOfBoundsPolicy::Clamp)
topMargin = qBound(d->m_minMargins.top(), topMargin, d->m_maxMargins.top());
- if (qFuzzyCompare(topMargin, d->m_margins.top()))
+ if (QtPrivate::fuzzyCompare(topMargin, d->m_margins.top()))
return true;
if (d->m_mode == FullPageMode
@@ -699,7 +699,7 @@ bool QPageLayout::setBottomMargin(qreal bottomMargin, OutOfBoundsPolicy outOfBou
if (d->m_mode == StandardMode && outOfBoundsPolicy == OutOfBoundsPolicy::Clamp)
bottomMargin = qBound(d->m_minMargins.bottom(), bottomMargin, d->m_maxMargins.bottom());
- if (qFuzzyCompare(bottomMargin, d->m_margins.bottom()))
+ if (QtPrivate::fuzzyCompare(bottomMargin, d->m_margins.bottom()))
return true;
if (d->m_mode == FullPageMode
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 74321705ff5..047be5f1c3d 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2952,9 +2952,9 @@ inline bool QRasterPaintEnginePrivate::isUnclipped(const QRectF &rect,
int penWidth) const
{
const QRectF norm = rect.normalized();
- if (norm.left() <= INT_MIN || norm.top() <= INT_MIN
- || norm.right() > INT_MAX || norm.bottom() > INT_MAX
- || norm.width() > INT_MAX || norm.height() > INT_MAX)
+ if (norm.left() <= qreal(INT_MIN) || norm.top() <= qreal(INT_MIN)
+ || norm.right() > qreal(INT_MAX) || norm.bottom() > qreal(INT_MAX)
+ || norm.width() > qreal(INT_MAX) || norm.height() > qreal(INT_MAX))
return false;
return isUnclipped(norm.toAlignedRect(), penWidth);
}
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm
index 7fa05f69232..0d4ce909daa 100644
--- a/src/gui/rhi/qrhimetal.mm
+++ b/src/gui/rhi/qrhimetal.mm
@@ -26,6 +26,8 @@
#include <Metal/Metal.h>
+#include <utility> // for std::pair
+
QT_BEGIN_NAMESPACE
/*
@@ -1674,12 +1676,12 @@ void QRhiMetal::setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBind
if (needsBufferSizeBuffer) {
QMetalBuffer *bufD = nullptr;
- QVarLengthArray<QPair<QMetalShader *, QRhiShaderResourceBinding::StageFlag>, 4> shaders;
+ QVarLengthArray<std::pair<QMetalShader *, QRhiShaderResourceBinding::StageFlag>, 4> shaders;
if (compPsD) {
bufD = compPsD->d->bufferSizeBuffer;
Q_ASSERT(compPsD->d->cs.nativeShaderInfo.extraBufferBindings.contains(QShaderPrivate::MslBufferSizeBufferBinding));
- shaders.append(qMakePair(&compPsD->d->cs, QRhiShaderResourceBinding::StageFlag::ComputeStage));
+ shaders.append({&compPsD->d->cs, QRhiShaderResourceBinding::StageFlag::ComputeStage});
} else {
bufD = gfxPsD->d->bufferSizeBuffer;
if (gfxPsD->d->tess.enabled) {
@@ -1706,24 +1708,24 @@ void QRhiMetal::setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBind
== gfxPsD->d->tess.compVs[2].nativeShaderInfo.extraBufferBindings[QShaderPrivate::MslBufferSizeBufferBinding]);
if (gfxPsD->d->tess.compVs[0].nativeShaderInfo.extraBufferBindings.contains(QShaderPrivate::MslBufferSizeBufferBinding))
- shaders.append(qMakePair(&gfxPsD->d->tess.compVs[0], QRhiShaderResourceBinding::StageFlag::VertexStage));
+ shaders.append({&gfxPsD->d->tess.compVs[0], QRhiShaderResourceBinding::StageFlag::VertexStage});
if (gfxPsD->d->tess.compTesc.nativeShaderInfo.extraBufferBindings.contains(QShaderPrivate::MslBufferSizeBufferBinding))
- shaders.append(qMakePair(&gfxPsD->d->tess.compTesc, QRhiShaderResourceBinding::StageFlag::TessellationControlStage));
+ shaders.append({&gfxPsD->d->tess.compTesc, QRhiShaderResourceBinding::StageFlag::TessellationControlStage});
if (gfxPsD->d->tess.vertTese.nativeShaderInfo.extraBufferBindings.contains(QShaderPrivate::MslBufferSizeBufferBinding))
- shaders.append(qMakePair(&gfxPsD->d->tess.vertTese, QRhiShaderResourceBinding::StageFlag::TessellationEvaluationStage));
+ shaders.append({&gfxPsD->d->tess.vertTese, QRhiShaderResourceBinding::StageFlag::TessellationEvaluationStage});
} else {
if (gfxPsD->d->vs.nativeShaderInfo.extraBufferBindings.contains(QShaderPrivate::MslBufferSizeBufferBinding))
- shaders.append(qMakePair(&gfxPsD->d->vs, QRhiShaderResourceBinding::StageFlag::VertexStage));
+ shaders.append({&gfxPsD->d->vs, QRhiShaderResourceBinding::StageFlag::VertexStage});
}
if (gfxPsD->d->fs.nativeShaderInfo.extraBufferBindings.contains(QShaderPrivate::MslBufferSizeBufferBinding))
- shaders.append(qMakePair(&gfxPsD->d->fs, QRhiShaderResourceBinding::StageFlag::FragmentStage));
+ shaders.append({&gfxPsD->d->fs, QRhiShaderResourceBinding::StageFlag::FragmentStage});
}
quint32 offset = 0;
- for (const QPair<QMetalShader *, QRhiShaderResourceBinding::StageFlag> &shader : shaders) {
+ for (const auto &shader : shaders) {
const int binding = shader.first->nativeShaderInfo.extraBufferBindings[QShaderPrivate::MslBufferSizeBufferBinding];
@@ -6030,7 +6032,7 @@ bool QMetalGraphicsPipeline::create()
for (QMetalShader *shader : shaders) {
if (shader->nativeShaderInfo.extraBufferBindings.contains(QShaderPrivate::MslBufferSizeBufferBinding)) {
const int binding = shader->nativeShaderInfo.extraBufferBindings[QShaderPrivate::MslBufferSizeBufferBinding];
- shader->nativeResourceBindingMap[binding] = qMakePair(binding, -1);
+ shader->nativeResourceBindingMap[binding] = {binding, -1};
int maxNativeBinding = 0;
for (const QShaderDescription::StorageBlock &block : shader->desc.storageBlocks())
maxNativeBinding = qMax(maxNativeBinding, shader->nativeResourceBindingMap[block.binding].first);
@@ -6148,7 +6150,7 @@ bool QMetalComputePipeline::create()
// SPIRV-Cross buffer size buffers
if (d->cs.nativeShaderInfo.extraBufferBindings.contains(QShaderPrivate::MslBufferSizeBufferBinding)) {
const int binding = d->cs.nativeShaderInfo.extraBufferBindings[QShaderPrivate::MslBufferSizeBufferBinding];
- d->cs.nativeResourceBindingMap[binding] = qMakePair(binding, -1);
+ d->cs.nativeResourceBindingMap[binding] = {binding, -1};
}
if (rhiD->d->shaderCache.count() >= QRhiMetal::MAX_SHADER_CACHE_ENTRIES) {
diff --git a/src/gui/text/freetype/qfontengine_ft.cpp b/src/gui/text/freetype/qfontengine_ft.cpp
index 63d9c2893dc..e331a4cc815 100644
--- a/src/gui/text/freetype/qfontengine_ft.cpp
+++ b/src/gui/text/freetype/qfontengine_ft.cpp
@@ -1225,7 +1225,7 @@ static inline QTransform FTAffineToQTransform(const FT_Affine23 &matrix)
}
bool QFontEngineFT::traverseColr1(FT_OpaquePaint opaquePaint,
- QSet<QPair<FT_Byte *, FT_Bool> > *loops,
+ QSet<std::pair<FT_Byte *, FT_Bool> > *loops,
QColor foregroundColor,
FT_Color *palette,
ushort paletteCount,
@@ -1233,7 +1233,7 @@ bool QFontEngineFT::traverseColr1(FT_OpaquePaint opaquePaint,
{
FT_Face face = freetype->face;
- auto key = qMakePair(opaquePaint.p, opaquePaint.insert_root_transform);
+ auto key = std::pair{opaquePaint.p, opaquePaint.insert_root_transform};
if (loops->contains(key)) {
qCWarning(lcColrv1) << "Cycle detected in COLRv1 graph";
return false;
@@ -1680,7 +1680,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadColrv1Glyph(QGlyphSet *set,
// Do a pass over the graph to find the bounds
QColrPaintGraphRenderer boundingRectCalculator;
boundingRectCalculator.beginCalculateBoundingBox();
- QSet<QPair<FT_Byte *, FT_Bool> > loops;
+ QSet<std::pair<FT_Byte *, FT_Bool> > loops;
if (traverseColr1(opaquePaint,
&loops,
QColor{},
@@ -1735,7 +1735,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadColrv1Glyph(QGlyphSet *set,
originalXform);
// Render
- QSet<QPair<FT_Byte *, FT_Bool> > loops;
+ QSet<std::pair<FT_Byte *, FT_Bool> > loops;
if (!traverseColr1(opaquePaint,
&loops,
foregroundColor,
diff --git a/src/gui/text/freetype/qfontengine_ft_p.h b/src/gui/text/freetype/qfontengine_ft_p.h
index fc07693ef6a..13cd1bf2bfa 100644
--- a/src/gui/text/freetype/qfontengine_ft_p.h
+++ b/src/gui/text/freetype/qfontengine_ft_p.h
@@ -34,6 +34,8 @@
#include <string.h>
#include <qpainterpath.h>
+#include <utility> // for std::pair
+
QT_BEGIN_NAMESPACE
class QFontEngineFTRawFont;
@@ -333,7 +335,7 @@ private:
bool fetchMetricsOnly) const;
bool traverseColr1(FT_OpaquePaint paint,
- QSet<QPair<FT_Byte *, FT_Bool> > *loops,
+ QSet<std::pair<FT_Byte *, FT_Bool> > *loops,
QColor foregroundColor,
FT_Color *palette,
ushort paletteCount,
diff --git a/src/gui/text/qcolrpaintgraphrenderer.cpp b/src/gui/text/qcolrpaintgraphrenderer.cpp
index 9041e804753..bc439021eb1 100644
--- a/src/gui/text/qcolrpaintgraphrenderer.cpp
+++ b/src/gui/text/qcolrpaintgraphrenderer.cpp
@@ -180,7 +180,7 @@ void QColrPaintGraphRenderer::setConicalGradient(QPointF center,
adaptedStops.reserve(gradientStops.size());
for (const QGradientStop &gradientStop : gradientStops)
- adaptedStops.append(qMakePair(gradientStop.first * multiplier, gradientStop.second));
+ adaptedStops.append({gradientStop.first * multiplier, gradientStop.second});
conicalGradient.setStops(adaptedStops);
conicalGradient.setCoordinateMode(QGradient::LogicalMode);
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 0ad45b1f280..d41296291f6 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -402,7 +402,7 @@ bool QFontEngine::processHheaTable() const
const qreal unitsPerEm = emSquareSize().toReal();
// Bail out if values are too large for QFixed
- const auto limitForQFixed = std::numeric_limits<int>::max() / (fontDef.pixelSize * 64);
+ const auto limitForQFixed = qreal(std::numeric_limits<int>::max() / 64) / fontDef.pixelSize;
if (ascent > limitForQFixed || descent > limitForQFixed || leading > limitForQFixed)
return false;
m_ascent = QFixed::fromReal(ascent * fontDef.pixelSize / unitsPerEm);
@@ -470,7 +470,7 @@ bool QFontEngine::processOS2Table() const
if (typoAscent == 0 && typoDescent == 0)
return false;
// Bail out if values are too large for QFixed
- const auto limitForQFixed = std::numeric_limits<int>::max() / (fontDef.pixelSize * 64);
+ const auto limitForQFixed = qreal(std::numeric_limits<int>::max() / 64) / fontDef.pixelSize;
if (typoAscent > limitForQFixed || typoDescent > limitForQFixed
|| typoLineGap > limitForQFixed)
return false;
@@ -481,7 +481,7 @@ bool QFontEngine::processOS2Table() const
// Some fonts may have invalid OS/2 data. We detect this and bail out.
if (winAscent == 0 && winDescent == 0)
return false;
- const auto limitForQFixed = std::numeric_limits<int>::max() / (fontDef.pixelSize * 64);
+ const auto limitForQFixed = qreal(std::numeric_limits<int>::max() / 64) / fontDef.pixelSize;
if (winAscent > limitForQFixed || winDescent > limitForQFixed)
return false;
m_ascent = QFixed::fromReal(winAscent * fontDef.pixelSize / unitsPerEm);
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index eb0f6c3710c..4f01d09fed1 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1976,7 +1976,7 @@ void QTextDocument::print(QPagedPaintDevice *printer) const
return;
bool documentPaginated = d->pageSize.isValid() && !d->pageSize.isNull()
- && d->pageSize.height() != INT_MAX;
+ && d->pageSize.height() != qreal(INT_MAX);
// ### set page size to paginated size?
QMarginsF m = printer->pageLayout().margins(QPageLayout::Millimeter);
diff --git a/src/gui/text/windows/qwindowsfontdatabasebase.cpp b/src/gui/text/windows/qwindowsfontdatabasebase.cpp
index 990f20fa447..055e616dbb2 100644
--- a/src/gui/text/windows/qwindowsfontdatabasebase.cpp
+++ b/src/gui/text/windows/qwindowsfontdatabasebase.cpp
@@ -18,6 +18,8 @@
# include "qwindowsfontenginedirectwrite_p.h"
#endif
+#include <utility> // for std::pair
+
QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
@@ -363,7 +365,7 @@ namespace {
inline void addKey(const QByteArray &fontData, const QString &filename)
{
if (!m_fontDatas.contains(fontData.data()))
- m_fontDatas.insert(fontData.data(), qMakePair(fontData, filename));
+ m_fontDatas.insert(fontData.data(), {fontData, filename});
}
HRESULT STDMETHODCALLTYPE GetFilePathLengthFromKey(void const* fontFileReferenceKey,
@@ -433,7 +435,7 @@ namespace {
private:
ULONG m_referenceCount;
- QHash<const void *, QPair<QByteArray, QString> > m_fontDatas;
+ QHash<const void *, std::pair<QByteArray, QString> > m_fontDatas;
};
HRESULT STDMETHODCALLTYPE DirectWriteFontFileLoader::QueryInterface(const IID &iid,
diff --git a/src/gui/text/windows/qwindowsfontenginedirectwrite.cpp b/src/gui/text/windows/qwindowsfontenginedirectwrite.cpp
index 3e10cdad44f..2f0ce3449d9 100644
--- a/src/gui/text/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/gui/text/windows/qwindowsfontenginedirectwrite.cpp
@@ -1074,7 +1074,7 @@ bool QWindowsFontEngineDirectWrite::traverseColr1(IDWritePaintReader *paintReade
for (int i = 0; i < stopCount; ++i) {
const D2D1_GRADIENT_STOP &stop = stops[i];
QColor color = QColor::fromRgbF(stop.color.r, stop.color.g, stop.color.b, stop.color.a);
- ret.append(qMakePair(stop.position, color));
+ ret.append({stop.position, color});
}
return ret;
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index f35b89d1aec..3f60c5b3925 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -259,7 +259,7 @@ public:
QString peerVerifyName;
- QTcpKeepAliveConfiguration tcpKeepAliveConfiguration;
+ QTcpKeepAliveConfiguration tcpKeepAliveConfiguration = {};
friend class QHttpNetworkConnectionChannel;
};
diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h
index f179d95ac17..5005f8c01c2 100644
--- a/src/network/access/qhttpthreaddelegate_p.h
+++ b/src/network/access/qhttpthreaddelegate_p.h
@@ -92,7 +92,7 @@ public:
QString incomingErrorDetail;
QHttp1Configuration http1Parameters;
QHttp2Configuration http2Parameters;
- QTcpKeepAliveConfiguration tcpKeepAliveParameters;
+ QTcpKeepAliveConfiguration tcpKeepAliveParameters = {};
protected:
// The zerocopy download buffer, if used:
diff --git a/src/plugins/platforms/wasm/qwasmdrag.cpp b/src/plugins/platforms/wasm/qwasmdrag.cpp
index 757959e5694..6447d1e399f 100644
--- a/src/plugins/platforms/wasm/qwasmdrag.cpp
+++ b/src/plugins/platforms/wasm/qwasmdrag.cpp
@@ -94,15 +94,13 @@ Qt::DropAction QWasmDrag::drag(QDrag *drag)
return Qt::IgnoreAction;
Qt::DropAction dragResult = Qt::IgnoreAction;
- if (qstdweb::haveJspi()) {
+ if (qstdweb::haveAsyncify()) {
m_dragState = std::make_unique<DragState>(drag, window, [this]() { QSimpleDrag::cancelDrag(); });
- QSimpleDrag::drag(drag);
- dragResult = m_dragState->dropAction;
+ dragResult = QSimpleDrag::drag(drag);
m_dragState.reset();
- }
-
- if (dragResult == Qt::IgnoreAction)
+ } else {
dragResult = QBasicDrag::drag(drag);
+ }
return dragResult;
}
@@ -117,6 +115,7 @@ void QWasmDrag::onNativeDragStarted(DragEvent *event)
event->cancelDragStart();
return;
}
+ setExecutedDropAction(event->dropAction);
// We have our own window
if (shapedPixmapWindow())
@@ -145,8 +144,10 @@ void QWasmDrag::onNativeDragOver(DragEvent *event)
event->mouseButton, event->modifiers);
event->acceptDragOver();
if (dragResponse.isAccepted()) {
+ setExecutedDropAction(dragResponse.acceptedAction());
event->dataTransfer.setDropAction(dragResponse.acceptedAction());
} else {
+ setExecutedDropAction(Qt::DropAction::IgnoreAction);
event->dataTransfer.setDropAction(Qt::DropAction::IgnoreAction);
}
}
@@ -174,6 +175,7 @@ void QWasmDrag::onNativeDrop(DragEvent *event)
// files, but the browser expects that accepted state is set before any
// async calls.
event->acceptDrop();
+ setExecutedDropAction(event->dropAction);
std::shared_ptr<DragState> dragState = m_dragState;
const auto dropCallback = [dragState, wasmWindow, targetWindowPos,
@@ -198,6 +200,7 @@ void QWasmDrag::onNativeDragFinished(DragEvent *event)
{
event->webEvent.call<void>("preventDefault");
m_dragState->dropAction = event->dropAction;
+ setExecutedDropAction(event->dropAction);
m_dragState->quitEventLoopClosure();
}
@@ -213,6 +216,8 @@ void QWasmDrag::onNativeDragEnter(DragEvent *event)
if (m_dragState)
m_dragState->dropAction = event->dropAction;
+ setExecutedDropAction(event->dropAction);
+
QDrag *drag = new QDrag(this);
drag->setMimeData(new QMimeData());
drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);
@@ -223,6 +228,7 @@ void QWasmDrag::onNativeDragLeave(DragEvent *event)
event->webEvent.call<void>("preventDefault");
if (m_dragState)
m_dragState->dropAction = event->dropAction;
+ setExecutedDropAction(event->dropAction);
event->dataTransfer.setDropAction(Qt::DropAction::IgnoreAction);
}
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp
index f27943070d0..2be05625971 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.cpp
+++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp
@@ -513,7 +513,6 @@ void QWaylandWindow::setGeometry(const QRect &r)
mWindowDecoration->update();
QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(window(), geometry());
- mSentInitialResize = true;
}
// Wayland has no concept of areas being exposed or not, only the entire window, when our geometry changes, we need to flag the new area as exposed
diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h
index 9e1bd92af30..7dda16cc776 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow_p.h
+++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h
@@ -334,7 +334,6 @@ protected:
int mFrameCallbackTimeout = 100;
QVariantMap m_properties;
- bool mSentInitialResize = false;
QPoint mOffset;
std::optional<qreal> mScale = std::nullopt;
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 2c56603fef0..7d5f0155960 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -2573,7 +2573,7 @@ void QXcbWindow::setOpacity(qreal level)
if (!m_window)
return;
- quint32 value = qRound64(qBound(qreal(0), level, qreal(1)) * 0xffffffff);
+ quint32 value = qRound64(qBound(qreal(0), level, qreal(1)) * qreal(0xffffffff));
xcb_change_property(xcb_connection(),
XCB_PROP_MODE_REPLACE,
diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp
index 6fd857828d3..7caa352afe4 100644
--- a/src/plugins/styles/modernwindows/qwindows11style.cpp
+++ b/src/plugins/styles/modernwindows/qwindows11style.cpp
@@ -917,7 +917,7 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption
const bool isReverse = option->direction == Qt::RightToLeft;
const bool isOpen = option->state & QStyle::State_Open;
QFont f(d->assetFont);
- f.setPointSize(6);
+ f.setPointSize(8);
painter->setFont(f);
painter->setPen(option->palette.color(isOpen ? QPalette::Active : QPalette::Disabled,
QPalette::WindowText));
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 6e7077b383e..94c75ae6eb3 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -78,16 +78,18 @@ QT_FOR_EACH_STATIC_TYPE(RETURN_METATYPENAME_STRING)
return nullptr;
}
- Generator::Generator(Moc *moc, ClassDef *classDef, const QList<QByteArray> &metaTypes,
+ Generator::Generator(Moc *moc, const ClassDef *classDef, const QList<QByteArray> &metaTypes,
const QHash<QByteArray, QByteArray> &knownQObjectClasses,
- const QHash<QByteArray, QByteArray> &knownGadgets, FILE *outfile,
- bool requireCompleteTypes)
+ const QHash<QByteArray, QByteArray> &knownGadgets,
+ const QHash<QByteArray, QByteArray> &hashes,
+ FILE *outfile, bool requireCompleteTypes)
: parser(moc),
out(outfile),
cdef(classDef),
metaTypes(metaTypes),
knownQObjectClasses(knownQObjectClasses),
knownGadgets(knownGadgets),
+ hashes(hashes),
requireCompleteTypes(requireCompleteTypes)
{
if (cdef->superclassList.size())
@@ -228,28 +230,11 @@ void Generator::generateCode()
bool isQObject = (cdef->classname == "QObject");
bool isConstructible = !cdef->constructorList.isEmpty();
- // filter out undeclared enumerators and sets
- {
- QList<EnumDef> enumList;
- for (EnumDef def : std::as_const(cdef->enumList)) {
- if (cdef->enumDeclarations.contains(def.name)) {
- enumList += def;
- }
- def.enumName = def.name;
- QByteArray alias = cdef->flagAliases.value(def.name);
- if (cdef->enumDeclarations.contains(alias)) {
- def.name = alias;
- def.flags |= cdef->enumDeclarations[alias];
- enumList += def;
- }
- }
- cdef->enumList = enumList;
- }
-
//
// Register all strings used in data section
//
strreg(cdef->qualified);
+ strreg(hashes[cdef->qualified]);
registerClassInfoStrings();
registerFunctionStrings(cdef->signalList);
registerFunctionStrings(cdef->slotList);
@@ -308,6 +293,8 @@ void Generator::generateCode()
addEnums();
fprintf(out, " };\n");
+ fprintf(out, " uint qt_metaObjectHashIndex = %d;\n", stridx(hashes[cdef->qualified]));
+
const char *uintDataParams = "";
if (isConstructible || !cdef->classInfoList.isEmpty()) {
if (isConstructible) {
@@ -340,7 +327,7 @@ void Generator::generateCode()
if (!requireCompleteness)
tagType = "qt_meta_tag_" + qualifiedClassNameIdentifier + "_t";
fprintf(out, " return QtMocHelpers::metaObjectData<%s, %s>(%s, qt_stringData,\n"
- " qt_methods, qt_properties, qt_enums%s);\n"
+ " qt_methods, qt_properties, qt_enums, qt_metaObjectHashIndex%s);\n"
"}\n",
ownType, tagType.constData(), metaObjectFlags, uintDataParams);
}
diff --git a/src/tools/moc/generator.h b/src/tools/moc/generator.h
index 45df0783c2b..77be2fc6714 100644
--- a/src/tools/moc/generator.h
+++ b/src/tools/moc/generator.h
@@ -12,14 +12,15 @@ class Generator
{
Moc *parser = nullptr;
FILE *out;
- ClassDef *cdef;
+ const ClassDef *cdef;
QList<uint> meta_data;
public:
- Generator(Moc *moc, ClassDef *classDef, const QList<QByteArray> &metaTypes,
+ Generator(Moc *moc, const ClassDef *classDef, const QList<QByteArray> &metaTypes,
const QHash<QByteArray, QByteArray> &knownQObjectClasses,
- const QHash<QByteArray, QByteArray> &knownGadgets, FILE *outfile = nullptr,
- bool requireCompleteTypes = false);
+ const QHash<QByteArray, QByteArray> &knownGadgets,
+ const QHash<QByteArray, QByteArray> &hashes,
+ FILE *outfile = nullptr, bool requireCompleteTypes = false);
void generateCode();
qsizetype registeredStringsCount() { return strings.size(); }
@@ -54,6 +55,7 @@ private:
QList<QByteArray> metaTypes;
QHash<QByteArray, QByteArray> knownQObjectClasses;
QHash<QByteArray, QByteArray> knownGadgets;
+ QHash<QByteArray, QByteArray> hashes;
bool requireCompleteTypes;
};
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index baa6690350d..7f05f34edb6 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -17,6 +17,10 @@
#include <private/qmetaobject_moc_p.h>
#include <private/qduplicatetracker_p.h>
+// This is a bootstrapped tool, so we can't rely on QCryptographicHash for the
+// faster SHA1 implementations from OpenSSL.
+#include "../../3rdparty/sha1/sha1.cpp"
+
QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
@@ -1191,6 +1195,24 @@ static QByteArrayList requiredQtContainers(const QList<ClassDef> &classes)
return required;
}
+QByteArray classDefJsonObjectHash(const QJsonObject &object)
+{
+ const QByteArray json = QJsonDocument(object).toJson(QJsonValue::JsonFormat::Compact);
+ QByteArray hash(20, 0); // SHA1 produces 160 bits of data
+
+ {
+ Sha1State state;
+ sha1InitState(&state);
+ sha1Update(&state, reinterpret_cast<const uchar *>(json.constData()), json.size());
+ sha1FinalizeState(&state);
+ sha1ToHash(&state, reinterpret_cast<uchar *>(hash.data()));
+ }
+
+ static const char revisionPrefix[] = "0$";
+ const QByteArray hashB64 = hash.toBase64(QByteArray::OmitTrailingEquals);
+ return revisionPrefix + hashB64;
+}
+
void Moc::generate(FILE *out, FILE *jsonOutput)
{
QByteArrayView fn = strippedFileName();
@@ -1247,14 +1269,40 @@ void Moc::generate(FILE *out, FILE *jsonOutput)
"#endif\n\n");
#endif
+ // filter out undeclared enumerators and sets
+ for (ClassDef &cdef : classList) {
+ QList<EnumDef> enumList;
+ for (EnumDef def : std::as_const(cdef.enumList)) {
+ if (cdef.enumDeclarations.contains(def.name)) {
+ enumList += def;
+ }
+ def.enumName = def.name;
+ QByteArray alias = cdef.flagAliases.value(def.name);
+ if (cdef.enumDeclarations.contains(alias)) {
+ def.name = alias;
+ def.flags |= cdef.enumDeclarations[alias];
+ enumList += def;
+ }
+ }
+ cdef.enumList = enumList;
+ }
+
fprintf(out, "QT_WARNING_PUSH\n");
fprintf(out, "QT_WARNING_DISABLE_DEPRECATED\n");
fprintf(out, "QT_WARNING_DISABLE_GCC(\"-Wuseless-cast\")\n");
+ QHash<QByteArray, QJsonObject> classDefJsonObjects;
+ QHash<QByteArray, QByteArray> metaObjectHashes;
+ for (const ClassDef &def : std::as_const(classList)) {
+ const QJsonObject jsonObject = def.toJson();
+ classDefJsonObjects.insert(def.qualified, jsonObject);
+ metaObjectHashes.insert(def.qualified, classDefJsonObjectHash(jsonObject));
+ }
+
fputs("", out);
- for (ClassDef &def : classList) {
- Generator generator(this, &def, metaTypes, knownQObjectClasses, knownGadgets, out,
- requireCompleteTypes);
+ for (const ClassDef &def : std::as_const(classList)) {
+ Generator generator(this, &def, metaTypes, knownQObjectClasses, knownGadgets,
+ metaObjectHashes, out, requireCompleteTypes);
generator.generateCode();
// generator.generateCode() should have already registered all strings
@@ -1273,13 +1321,20 @@ void Moc::generate(FILE *out, FILE *jsonOutput)
mocData["inputFile"_L1] = QLatin1StringView(fn.constData());
QJsonArray classesJsonFormatted;
+ QJsonObject hashesJsonObject;
- for (const ClassDef &cdef: std::as_const(classList))
- classesJsonFormatted.append(cdef.toJson());
+ for (const ClassDef &cdef : std::as_const(classList)) {
+ classesJsonFormatted.append(classDefJsonObjects[cdef.qualified]);
+ hashesJsonObject.insert(QString::fromLatin1(cdef.qualified),
+ QString::fromLatin1(metaObjectHashes[cdef.qualified]));
+ }
if (!classesJsonFormatted.isEmpty())
mocData["classes"_L1] = classesJsonFormatted;
+ if (!hashesJsonObject.isEmpty())
+ mocData["hashes"_L1] = hashesJsonObject;
+
QJsonDocument jsonDoc(mocData);
fputs(jsonDoc.toJson().constData(), jsonOutput);
}
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 3575eb78ac4..9b6b96d911b 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1537,8 +1537,12 @@ void QMenuPrivate::_q_actionTriggered()
}
activateCausedStack(list, action, QAction::Trigger, false);
// if a widget action fires, we need to hide the menu explicitly
- if (qobject_cast<QWidgetAction*>(action))
+ if (qobject_cast<QWidgetAction*>(action)) {
+ // make sure QMenu::exec returns the triggered widget action
+ currentAction = action;
+ setSyncAction();
hideUpToMenuBar();
+ }
}
}
}
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json
index 9bd20506429..28be7330cc1 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json
@@ -14,6 +14,9 @@
]
}
],
+ "hashes": {
+ "MetaType": "0$swya0mP+olQ6EImtfZ4HW3dVkKs"
+ },
"inputFile": "MetaType.h",
"outputRevision": 69
}
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json
index fe80985f796..576668df12f 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json
@@ -30,6 +30,9 @@
]
}
],
+ "hashes": {
+ "MetaType": "0$NMxUTKrEcV2vk8Gr4Jl/SR4Q7/c"
+ },
"inputFile": "MetaType.h",
"outputRevision": 69
}
diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
index 67643606fa3..a441ed8f7ee 100644
--- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
+++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
@@ -77,6 +77,9 @@ class SomethingOfEverything : public QObject
Q_PROPERTY(SomethingEnum eprop READ eprop)
Q_PROPERTY(SomethingFlagEnum fprop READ fprop)
Q_PROPERTY(QLocale::Language language READ language)
+ Q_PROPERTY(QString virtualP READ prop VIRTUAL)
+ // Doesn't override anything, used only to verify MOC handling of OVERRIDE keyword
+ Q_PROPERTY(QString overrideP READ prop OVERRIDE)
public:
Q_INVOKABLE SomethingOfEverything() {}
~SomethingOfEverything() {}
@@ -577,6 +580,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!nullProp.isEnumOrFlag());
QVERIFY(!nullProp.isConstant());
QVERIFY(!nullProp.isFinal());
+ QVERIFY(!nullProp.isVirtual());
+ QVERIFY(!nullProp.isOverride());
QCOMPARE(nullProp.index(), 0);
QCOMPARE(nullProp.revision(), 0);
@@ -596,6 +601,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!prop1.isEnumOrFlag());
QVERIFY(!prop1.isConstant());
QVERIFY(!prop1.isFinal());
+ QVERIFY(!prop1.isVirtual());
+ QVERIFY(!prop1.isOverride());
QCOMPARE(prop1.revision(), 0);
QCOMPARE(prop1.index(), 0);
QCOMPARE(builder.propertyCount(), 1);
@@ -616,6 +623,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!prop2.isEnumOrFlag());
QVERIFY(!prop2.isConstant());
QVERIFY(!prop2.isFinal());
+ QVERIFY(!prop2.isVirtual());
+ QVERIFY(!prop2.isOverride());
QCOMPARE(prop2.revision(), 0);
QCOMPARE(prop2.index(), 1);
QCOMPARE(builder.propertyCount(), 2);
@@ -669,6 +678,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!prop2.isEnumOrFlag());
QVERIFY(!prop2.isConstant());
QVERIFY(!prop2.isFinal());
+ QVERIFY(!prop2.isVirtual());
+ QVERIFY(!prop2.isOverride());
QCOMPARE(prop2.revision(), 0);
// Remove prop1 and check that prop2 becomes index 0.
@@ -686,6 +697,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!prop2.isEnumOrFlag());
QVERIFY(!prop2.isConstant());
QVERIFY(!prop2.isFinal());
+ QVERIFY(!prop2.isVirtual());
+ QVERIFY(!prop2.isOverride());
QCOMPARE(prop2.revision(), 0);
QCOMPARE(prop2.index(), 0);
@@ -711,6 +724,8 @@ void tst_QMetaObjectBuilder::property()
prop2.setEnumOrFlag(false); \
prop2.setConstant(false); \
prop2.setFinal(false); \
+ prop2.setVirtual(false); \
+ prop2.setOverride(false); \
prop2.setBindable(false); \
prop2.setRequired(false); \
} while (0)
@@ -727,6 +742,8 @@ void tst_QMetaObjectBuilder::property()
prop2.setEnumOrFlag(true); \
prop2.setConstant(true); \
prop2.setFinal(true); \
+ prop2.setVirtual(true); \
+ prop2.setOverride(true); \
prop2.setBindable(true); \
prop2.setRequired(true); \
} while (0)
@@ -742,6 +759,8 @@ void tst_QMetaObjectBuilder::property()
(prop2.isEnumOrFlag() ? 1 : 0) + \
(prop2.isConstant() ? 1 : 0) + \
(prop2.isFinal() ? 1 : 0) + \
+ (prop2.isVirtual() ? 1 : 0) + \
+ (prop2.isOverride() ? 1 : 0) + \
(prop2.isBindable() ? 1 : 0) + \
(prop2.isRequired() ? 1 : 0))
#define CHECK_FLAG(setFunc,isFunc) \
@@ -766,6 +785,8 @@ void tst_QMetaObjectBuilder::property()
CHECK_FLAG(setConstant, isConstant);
CHECK_FLAG(setBindable, isBindable);
CHECK_FLAG(setFinal, isFinal);
+ CHECK_FLAG(setVirtual, isVirtual);
+ CHECK_FLAG(setOverride, isOverride);
CHECK_FLAG(setRequired, isRequired);
SET_ALL_FLAGS();
QCOMPARE(COUNT_FLAGS(), flagCounter);
@@ -782,6 +803,22 @@ void tst_QMetaObjectBuilder::property()
QCOMPARE(prototypeProp.notifySignal().signature(), QByteArray("propChanged(QString)"));
QCOMPARE(builder.methodCount(), 1);
QCOMPARE(builder.method(0).signature(), QByteArray("propChanged(QString)"));
+
+ // virt specifiers
+ { //Q_PROPERTY(int virtualP READ prop VIRTUAL)
+ QMetaProperty prototype = SomethingOfEverything::staticMetaObject.property(7);
+ QMetaPropertyBuilder prototypeProp = builder.addProperty(prototype);
+ QCOMPARE(prototypeProp.isVirtual(), true);
+ QCOMPARE(prototypeProp.isOverride(), false);
+ QCOMPARE(prototypeProp.isFinal(), false);
+ }
+ { // Q_PROPERTY(int overrideP READ prop OVERRIDE)
+ QMetaProperty prototype = SomethingOfEverything::staticMetaObject.property(8);
+ QMetaPropertyBuilder prototypeProp = builder.addProperty(prototype);
+ QCOMPARE(prototypeProp.isVirtual(), false);
+ QCOMPARE(prototypeProp.isOverride(), true);
+ QCOMPARE(prototypeProp.isFinal(), false);
+ }
}
void tst_QMetaObjectBuilder::variantProperty()
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index c65f6645d01..4fbaed0d7b3 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -2988,6 +2988,10 @@ void tst_QAccessibility::listTest()
model->appendRow({new QStandardItem("Norway"), new QStandardItem("Oslo"), new QStandardItem("NOK")});
model->appendRow({new QStandardItem("Germany"), new QStandardItem("Berlin"), new QStandardItem("EUR")});
model->appendRow({new QStandardItem("Australia"), new QStandardItem("Brisbane"), new QStandardItem("AUD")});
+ model->item(0, 1)->setCheckable(true);
+ model->item(1, 1)->setCheckable(true);
+ model->item(2, 1)->setCheckable(true);
+ model->item(2, 1)->setCheckState(Qt::Checked);
auto lvHolder = std::make_unique<QListView>();
auto listView = lvHolder.get();
listView->setModel(model);
@@ -3016,16 +3020,19 @@ void tst_QAccessibility::listTest()
QCOMPARE(iface->indexOfChild(child1), 0);
QCOMPARE(child1->text(QAccessible::Name), QString("Oslo"));
QCOMPARE(child1->role(), QAccessible::ListItem);
+ QVERIFY(child1->state().checkable);
QAccessibleInterface *child2 = iface->child(1);
QVERIFY(child2);
QCOMPARE(iface->indexOfChild(child2), 1);
QCOMPARE(child2->text(QAccessible::Name), QString("Berlin"));
+ QVERIFY(child2->state().checkable);
QAccessibleInterface *child3 = iface->child(2);
QVERIFY(child3);
QCOMPARE(iface->indexOfChild(child3), 2);
QCOMPARE(child3->text(QAccessible::Name), QString("Brisbane"));
+ QVERIFY(child3->state().checkable);
}
// Check that application is accessible parent, since it's a top-level widget
@@ -3044,9 +3051,21 @@ void tst_QAccessibility::listTest()
// skip focus event tests on platforms where window focus cannot be ensured
const bool checkFocus = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation);
if (checkFocus) {
+ QVERIFY(QTest::qWaitForWindowActive(listView));
+
QAccessibleEvent focusEvent(listView, QAccessible::Focus);
focusEvent.setChild(1);
QVERIFY(QTestAccessibility::containsEvent(&focusEvent));
+
+ // check the item
+ QVERIFY(!iface->child(1)->state().checked);
+ QTest::keyClick(listView, Qt::Key_Space);
+ QVERIFY(iface->child(1)->state().checked);
+ QAccessible::State s;
+ s.checked = true;
+ QAccessibleStateChangeEvent checkedStateChangedEvent(listView, s);
+ checkedStateChangedEvent.setChild(1);
+ QVERIFY(QTestAccessibility::containsEvent(&checkedStateChangedEvent));
}
QTest::mouseClick(listView->viewport(), Qt::LeftButton, { }, listView->visualRect(model->index(2, listView->modelColumn())).center());
@@ -3058,6 +3077,16 @@ void tst_QAccessibility::listTest()
QAccessibleEvent focusEvent2(listView, QAccessible::Focus);
focusEvent2.setChild(2);
QVERIFY(QTestAccessibility::containsEvent(&focusEvent2));
+
+ // uncheck the item
+ QVERIFY(iface->child(2)->state().checked);
+ QTest::keyClick(listView, Qt::Key_Space);
+ QVERIFY(!iface->child(2)->state().checked);
+ QAccessible::State s;
+ s.checked = true;
+ QAccessibleStateChangeEvent checkedStateChangedEvent(listView, s);
+ checkedStateChangedEvent.setChild(2);
+ QVERIFY(QTestAccessibility::containsEvent(&checkedStateChangedEvent));
}
QAccessibleTableInterface *table = iface->tableInterface();
@@ -3174,6 +3203,7 @@ void tst_QAccessibility::treeTest()
QTreeWidgetItem *item1 = new QTreeWidgetItem;
item1->setText(0, "Picasso");
item1->setText(1, "Guernica");
+ item1->setCheckState(0, Qt::Unchecked);
root1->addChild(item1);
QTreeWidgetItem *item2 = new QTreeWidgetItem;
@@ -3188,6 +3218,7 @@ void tst_QAccessibility::treeTest()
QTreeWidgetItem *item3 = new QTreeWidgetItem;
item3->setText(0, "Klimt");
item3->setText(1, "The Kiss");
+ item3->setCheckState(0, Qt::Checked);
root2->addChild(item3);
treeView->resize(400,400);
@@ -3291,6 +3322,40 @@ void tst_QAccessibility::treeTest()
QCOMPARE(table2->columnDescription(0), QString("Artist"));
QCOMPARE(table2->columnDescription(1), QString("Work"));
+ // skip accessible state change event tests on platforms where window focus cannot be ensured
+ if (QGuiApplicationPrivate::platformIntegration()->hasCapability(
+ QPlatformIntegration::WindowActivation)) {
+ QVERIFY(QTest::qWaitForWindowActive(treeView.get()));
+
+ // check item1 (Picasso)
+ QVERIFY(cell1->state().checkable);
+ QVERIFY(!cell1->state().checked);
+ treeView->setCurrentItem(item1);
+ QTest::keyClick(treeView.get(), Qt::Key_Space);
+ QVERIFY(cell1->state().checked);
+ {
+ QAccessible::State s;
+ s.checked = true;
+ QAccessibleStateChangeEvent checkedStateChangedEvent(treeView.get(), s);
+ checkedStateChangedEvent.setChild(iface->indexOfChild(cell1));
+ QVERIFY(QTestAccessibility::containsEvent(&checkedStateChangedEvent));
+ }
+
+ // uncheck item3 (Klimt)
+ QVERIFY(cell2->state().checkable);
+ QVERIFY(cell2->state().checked);
+ treeView->setCurrentItem(item3);
+ QTest::keyClick(treeView.get(), Qt::Key_Space);
+ QVERIFY(!cell2->state().checked);
+ {
+ QAccessible::State s;
+ s.checked = true;
+ QAccessibleStateChangeEvent checkedStateChangedEvent(treeView.get(), s);
+ checkedStateChangedEvent.setChild(iface->indexOfChild(cell2));
+ QVERIFY(QTestAccessibility::containsEvent(&checkedStateChangedEvent));
+ }
+ }
+
QTestAccessibility::clearEvents();
}
@@ -3315,6 +3380,7 @@ void tst_QAccessibility::tableTest()
for (int i = 0; i<9; ++i) {
QTableWidgetItem *item = new QTableWidgetItem;
item->setText(QString::number(i/3) + QString(".") + QString::number(i%3));
+ item->setCheckState(Qt::Unchecked);
tableView->setItem(i/3, i%3, item);
}
@@ -3582,6 +3648,40 @@ void tst_QAccessibility::tableTest()
tableView->horizontalHeader()->setVisible(false);
}
+
+ // skip accessible state change event tests on platforms where window focus cannot be ensured
+ if (QGuiApplicationPrivate::platformIntegration()->hasCapability(
+ QPlatformIntegration::WindowActivation)) {
+ QVERIFY(QTest::qWaitForWindowActive(tableView));
+
+ // check cell (0, 0)
+ tableView->setCurrentItem(tableView->item(0, 0));
+ QVERIFY(cell00->state().checkable);
+ QVERIFY(!cell00->state().checked);
+ QTest::keyClick(tableView, Qt::Key_Space);
+ QVERIFY(cell00->state().checked);
+ {
+ QAccessible::State s;
+ s.checked = true;
+ QAccessibleStateChangeEvent checkedStateChangedEvent(tableView, s);
+ checkedStateChangedEvent.setChild(iface->indexOfChild(cell00));
+ QVERIFY(QTestAccessibility::containsEvent(&checkedStateChangedEvent));
+ }
+
+ QTestAccessibility::clearEvents();
+
+ // uncheck cell (0, 0) again
+ QTest::keyClick(tableView, Qt::Key_Space);
+ QVERIFY(!cell00->state().checked);
+ {
+ QAccessible::State s;
+ s.checked = true;
+ QAccessibleStateChangeEvent checkedStateChangedEvent(tableView, s);
+ checkedStateChangedEvent.setChild(iface->indexOfChild(cell00));
+ QVERIFY(QTestAccessibility::containsEvent(&checkedStateChangedEvent));
+ }
+ }
+
{
QTestAccessibility::clearEvents();
auto cell0 = table2->cellAt(0, 2);
diff --git a/tests/auto/tools/moc/allmocs_baseline_in.json b/tests/auto/tools/moc/allmocs_baseline_in.json
index d8e6c4df538..d36bdb907ae 100644
--- a/tests/auto/tools/moc/allmocs_baseline_in.json
+++ b/tests/auto/tools/moc/allmocs_baseline_in.json
@@ -23,6 +23,9 @@
]
}
],
+ "hashes": {
+ "BackslashNewlines": "0$VAkStqKr6pw5W81yZ3rCFn98h9U"
+ },
"inputFile": "backslash-newlines.h",
"outputRevision": 69
},
@@ -41,6 +44,9 @@
]
}
],
+ "hashes": {
+ "IfdefedClass": "0$OochknExuVUAqq2zc5gt2Ldj4+4"
+ },
"inputFile": "c-comments.h",
"outputRevision": 69
},
@@ -75,6 +81,9 @@
"qualifiedClassName": "CStyleEnums"
}
],
+ "hashes": {
+ "CStyleEnums": "0$fqbHabuJUT79FJr/S/6WsAiFcJI"
+ },
"inputFile": "cstyle-enums.h",
"outputRevision": 69
},
@@ -325,6 +334,11 @@
]
}
],
+ "hashes": {
+ "CXX11Enums": "0$SPzFG1raX8GCqiq6g21PoU/7ixs",
+ "CXX11Enums2": "0$uYFCI2+nT8TI8jLcKAvO8vp9OYA",
+ "CXX11Enums3": "0$bRezVo4UbDNuGatmLEd0/n8K8FA"
+ },
"inputFile": "cxx11-enums.h",
"outputRevision": 69
},
@@ -727,6 +741,17 @@
]
}
],
+ "hashes": {
+ "ExplicitOverrideControlBase": "0$PFsRqLGh0wP5gfqwF9CVeUi9EVU",
+ "ExplicitOverrideControlFinalCxx11": "0$RQTN9wEJCVZ1N4IcieHs2LuRKY8",
+ "ExplicitOverrideControlFinalCxx11OverrideCxx11": "0$ZEBCUhi5oEGiDVdmoqD+x4n1KJk",
+ "ExplicitOverrideControlFinalQt": "0$GuS6YD8Kcf/9KyehmFsrmDWW42M",
+ "ExplicitOverrideControlFinalQtOverrideQt": "0$q48mSBftA2LJFVSB4uqTmKs2gOc",
+ "ExplicitOverrideControlOverrideCxx11": "0$he1BJyFAtIcrEf74bZY1d54aCbc",
+ "ExplicitOverrideControlOverrideQt": "0$dWQ+iDw9oKEYXiSgy2izIISyRMg",
+ "ExplicitOverrideControlSealed": "0$3nq5psg7nFNDlPnBpaYraCr3CHQ",
+ "ExplicitOverrideControlSealedOverride": "0$I7ySe3SgUSARroswRh74wJoZkkA"
+ },
"inputFile": "cxx11-explicit-override-control.h",
"outputRevision": 69
},
@@ -850,6 +875,17 @@
]
}
],
+ "hashes": {
+ "ExportedFinalTestClassCpp11": "0$eUEIDQi+/lB9KOjB+oul4rZe9xE",
+ "ExportedFinalTestClassCpp11X": "0$g03sLKAEeX8BLjKjFsG3MMfunaY",
+ "ExportedFinalTestClassQt": "0$fYFeeRSmEnokVTW4eIiCU6PR5HM",
+ "ExportedFinalTestClassQtX": "0$7+xgvb70xVV3Xot9q7FhSm8mUew",
+ "ExportedSealedTestClass": "0$jzcARHlbTm1whxXOtg9edtN1ctg",
+ "ExportedSealedTestClassX": "0$tEmYiad6hqJMlGaCnNc2GhZtDgM",
+ "FinalTestClassCpp11": "0$Opb/8DnbfVjpH2CZvHo9Rv93iV8",
+ "FinalTestClassQt": "0$DtnHOKRNbQ5Y3QbO5AeLM4qYDW0",
+ "SealedTestClass": "0$VUU19XJgT+KhqRBlwQmXkd0yVgQ"
+ },
"inputFile": "cxx11-final-classes.h",
"outputRevision": 69
},
@@ -937,6 +973,9 @@
]
}
],
+ "hashes": {
+ "CXX11TrailingReturn": "0$UrmUM8dix1r2pcj94cUzTALq0x8"
+ },
"inputFile": "cxx11-trailing-return.h",
"outputRevision": 69
},
@@ -977,6 +1016,10 @@
"qualifiedClassName": "CXX17Namespace::A::B::C::D"
}
],
+ "hashes": {
+ "CXX17Namespace::A::B::C::D": "0$WwEpzp6jKMGQfcvBrtsAJOy01KM",
+ "CXX17Namespace::A::B::C::D::ClassInNamespace": "0$/g09nq8R/tK4tC37pIgfRw/mBog"
+ },
"inputFile": "cxx17-namespaces.h",
"outputRevision": 69
},
@@ -1007,6 +1050,9 @@
]
}
],
+ "hashes": {
+ "DirInIncludePath": "0$Yj0uFD5gTp9Ie67oMAyjAEUetbo"
+ },
"inputFile": "dir-in-include-path.h",
"outputRevision": 69
},
@@ -1025,6 +1071,9 @@
]
}
],
+ "hashes": {
+ "Foo": "0$CB6VdqlszayDKadxVcYxPz1KzvI"
+ },
"inputFile": "enum_with_include.h",
"outputRevision": 69
},
@@ -1057,6 +1106,9 @@
]
}
],
+ "hashes": {
+ "StringLiterals": "0$ZMhjewm0f9PVVN6Nf31Slot+IRo"
+ },
"inputFile": "escapes-in-string-literals.h",
"outputRevision": 69
},
@@ -1295,6 +1347,9 @@
]
}
],
+ "hashes": {
+ "ForwardDeclaredParamClass": "0$1v+gvQyQz9IWyRMSBZJfmhZpCw4"
+ },
"inputFile": "forward-declared-param.h",
"outputRevision": 69
},
@@ -1329,6 +1384,9 @@
]
}
],
+ "hashes": {
+ "FunctionWithAttributes": "0$PHwt9wN4wGfmeCWQSXJ4CFyLKCk"
+ },
"inputFile": "function-with-attributes.h",
"outputRevision": 69
},
@@ -1364,6 +1422,10 @@
]
}
],
+ "hashes": {
+ "DerivedGadgetWithEnums": "0$ziLf2XE3jIzXb4mHc1AtXn2Pr+w",
+ "GadgetWithNoEnums": "0$Jahs+W0ABVb+g0vSoUQ80hLQCzk"
+ },
"inputFile": "gadgetwithnoenums.h",
"outputRevision": 69
},
@@ -1400,6 +1462,11 @@
]
}
],
+ "hashes": {
+ "GrandParentGadget::BaseGadget": "0$edRI9jp0xvXAhzuu71v5ByBmvbw",
+ "GrandParentGadget::CRTPDerivedGadget": "0$Y3W4552o/BUqjdHf2NxgqKGkRmI",
+ "GrandParentGadget::DerivedGadget": "0$AhUcr6i4Hne/y216sE3UnzvaBks"
+ },
"inputFile": "grand-parent-gadget-class.h",
"outputRevision": 69
},
@@ -1471,6 +1538,10 @@
"qualifiedClassName": "SomeRandomNamespace"
}
],
+ "hashes": {
+ "SomeRandomNamespace": "0$haTJ0XROzXzF0eXH4sreUExdPxg",
+ "TestFwdProperties": "0$3+84uwm9jhX5WgZzqClAZM6h7Hg"
+ },
"inputFile": "moc_include.h",
"outputRevision": 69
},
@@ -1541,6 +1612,11 @@
"qualifiedClassName": "FooNamespace::FooNestedNamespace::FooMoreNestedNamespace"
}
],
+ "hashes": {
+ "FooNamespace": "0$Z0uaI0MMFqu0YzU7vExYNRUcBhs",
+ "FooNamespace::FooNestedNamespace": "0$c0mGYICDOoC4QPdVm5HRH9ApH68",
+ "FooNamespace::FooNestedNamespace::FooMoreNestedNamespace": "0$FHRRWVs1L+xEcXWY318xVxYlx+Y"
+ },
"inputFile": "namespace.h",
"outputRevision": 69
},
@@ -1572,6 +1648,10 @@
]
}
],
+ "hashes": {
+ "QTBUG_101141::Base": "0$U366MOIqv3M+uAirFGzc/YkYdoA",
+ "QTBUG_101141::Derived": "0$RhyA1CgCTHJhP+oLRVIDYv85oNQ"
+ },
"inputFile": "namespaced-base-class.h",
"outputRevision": 69
},
@@ -1664,6 +1744,10 @@
]
}
],
+ "hashes": {
+ "Foo::Bar": "0$bYnwxHCP+WvK/RySc0Cz7hJ/Mv4",
+ "Foo::Baz": "0$/xEtUkDT353vJHNrTTLCovKNWyo"
+ },
"inputFile": "namespaced-flags.h",
"outputRevision": 69
},
@@ -1700,6 +1784,9 @@
]
}
],
+ "hashes": {
+ "MyBooooooostishClass": "0$RDRAZTtVcMrrVnaW3ccG5tm5kvU"
+ },
"inputFile": "no-keywords.h",
"outputRevision": 69
},
@@ -1718,6 +1805,9 @@
]
}
],
+ "hashes": {
+ "NonGadgetParent::Derived": "0$3bsnxOwlHgO7cAngQLFI5JRtpDE"
+ },
"inputFile": "non-gadget-parent-class.h",
"outputRevision": 69
},
@@ -1784,6 +1874,9 @@
]
}
],
+ "hashes": {
+ "OldStyleCast": "0$tg567Jxb/wczCGYgDo7CHjLQaF8"
+ },
"inputFile": "oldstyle-casts.h",
"outputRevision": 69
},
@@ -2027,6 +2120,9 @@
]
}
],
+ "hashes": {
+ "PD::ParseDefine": "0$gtPGvhjjReF7/9ujAvwWNaRWEdk"
+ },
"inputFile": "parse-defines.h",
"outputRevision": 69
},
@@ -2045,6 +2141,9 @@
]
}
],
+ "hashes": {
+ "TestPluginMetaData": "0$D43pha4BOvdLMUbKSF0Pw0b2rfQ"
+ },
"inputFile": "plugin_metadata.h",
"outputRevision": 69
},
@@ -2149,6 +2248,9 @@
]
}
],
+ "hashes": {
+ "TestPointeeCanBeIncomplete": "0$BXzN6PCuKk/qhZeYZaaNyUNKW/8"
+ },
"inputFile": "pointery_to_incomplete.h",
"outputRevision": 69
},
@@ -2230,6 +2332,10 @@
]
}
],
+ "hashes": {
+ "PureVirtualSignalsImpl": "0$+RHy7vy0RgivuAtQW3Dohe0R+qk",
+ "PureVirtualSignalsTest": "0$31whJazqnFwWMc3cO9MaT9wBSy8"
+ },
"inputFile": "pure-virtual-signals.h",
"outputRevision": 69
},
@@ -2302,6 +2408,10 @@
]
}
],
+ "hashes": {
+ "QEnum64Object": "0$mPIUjAUmfYvqxkkkXghMo9RAiZA",
+ "QFlags64Object": "0$o86jnlU0tZ0uyjOrEZ4/oOXAKfk"
+ },
"inputFile": "qflags64object.h",
"outputRevision": 69
},
@@ -2358,6 +2468,10 @@
]
}
],
+ "hashes": {
+ "InvokableBeforeInline": "0$t5nSESnZz1Liw62inFXd2SZTQTg",
+ "InvokableBeforeReturnType": "0$q7unyP9EifVhdxdSVIaFweQMDs4"
+ },
"inputFile": "qinvokable.h",
"outputRevision": 69
},
@@ -2397,6 +2511,9 @@
]
}
],
+ "hashes": {
+ "QmlMacro": "0$ohmDXSSvwPL9cUf7TItBqGRGOXM"
+ },
"inputFile": "qmlmacro.h",
"outputRevision": 69
},
@@ -2433,6 +2550,9 @@
]
}
],
+ "hashes": {
+ "TestQPrivateSlots": "0$akM0QTpV2o3AF3v6YBUh+iY1NsM"
+ },
"inputFile": "qprivateslots.h",
"outputRevision": 69
},
@@ -2456,6 +2576,9 @@
"qualifiedClassName": "QTBUG_35657::A"
}
],
+ "hashes": {
+ "QTBUG_35657::A": "0$ExnqnOcM0keSitP69QEKBZXt4Es"
+ },
"inputFile": "qtbug-35657-gadget.h",
"outputRevision": 69
},
@@ -2490,6 +2613,9 @@
]
}
],
+ "hashes": {
+ "QTBUG_35657::B": "0$72RlEvuVajxk55rzeym5e5E7LmA"
+ },
"inputFile": "related-metaobjects-in-gadget.h",
"outputRevision": 69
},
@@ -2547,6 +2673,10 @@
]
}
],
+ "hashes": {
+ "QTBUG_2151::A": "0$wwzOwB54lloQnRalZ9IiAf2oCII",
+ "QTBUG_2151::B": "0$b4fk7Aaf9GubBohh4VCfABMTEJM"
+ },
"inputFile": "related-metaobjects-in-namespaces.h",
"outputRevision": 69
},
@@ -3029,6 +3159,28 @@
]
}
],
+ "hashes": {
+ "NS1::DependingNestedGadget": "0$AjMR5Q0D2DupU0l/8Fl2wE0HX/w",
+ "NS1::DependingNestedObject": "0$DopB5FLdxxGgVBjg2pb8LDui8hA",
+ "NS1::DependingObject": "0$NBnkXMTHy3+HN77VtSKqsQrn2Ds",
+ "NS1::Gadget": "0$x+7FBtXOnCa+gBCDQYYJELL4q6I",
+ "NS1::Nested::Gadget": "0$QrFH5wzXn6x40CgbEt6o8+GwAEw",
+ "NS1::Nested::Object": "0$pMIVvuQb0tyLZ5mwRFw8QDUTsPE",
+ "NS1::NestedUnsused::Gadget": "0$ksUC+FXicub96bqLdCnYlMjTIQg",
+ "NS1::NestedUnsused::Object": "0$Cu9dTusUon5OJbsbCNDszsTWsk4",
+ "NS1::Object": "0$FkizYy4XPEX9QPIyL2eE9bFYc5E",
+ "NS2::DependingNestedGadget": "0$DMnk8/Na+tVbOCW2bDplJtp+qfI",
+ "NS2::DependingNestedObject": "0$us8HSPRnoTuPP+yEIj9VoF0+wgY",
+ "NS2::DependingObject": "0$Y9OXadBw3CKbCLiiIcwarWKy4Ko",
+ "NS2::Gadget": "0$1c2uSbAFT5taj/PGDXyGdXgWhk0",
+ "NS2::Nested::Gadget": "0$1Xmv0ccjZFLq/Y68TxyTQNopa8E",
+ "NS2::Nested::Object": "0$usRIIUM8ix6bMuqFyxtLIGnTAew",
+ "NS2::NestedUnsused::Gadget": "0$V8PumQY6aJmatQ/V72bPVRUyPtM",
+ "NS2::NestedUnsused::Object": "0$HJl5p4/beto2yDugYIrnCfTIRm0",
+ "NS2::Object": "0$qx8DIVSOVAgRXwqE1JjvDXnuM44",
+ "Unsused::Gadget": "0$9DYMYjqKdVlC6OknSGIF2TCoZJo",
+ "Unsused::Object": "0$KW85gaAnMYh4a0phjBcM1vGAyKw"
+ },
"inputFile": "related-metaobjects-name-conflict.h",
"outputRevision": 69
},
@@ -3070,6 +3222,9 @@
]
}
],
+ "hashes": {
+ "SignalWithDefaultArg": "0$nxiVjK8ieRlRO/uDdq0gKtPSgTU"
+ },
"inputFile": "signal-with-default-arg.h",
"outputRevision": 69
},
@@ -3099,6 +3254,9 @@
]
}
],
+ "hashes": {
+ "KDAB": "0$grAoknUYC0BkMxt4HLH2mGR4Tu8"
+ },
"inputFile": "single-quote-digit-separator-n3781.h",
"outputRevision": 69
},
@@ -3180,6 +3338,9 @@
]
}
],
+ "hashes": {
+ "SlotsWithVoidTemplateTest": "0$/08YvkDzSSJmzKO0L6t3PWzQTpA"
+ },
"inputFile": "slots-with-void-template.h",
"outputRevision": 69
},
@@ -3198,6 +3359,9 @@
]
}
],
+ "hashes": {
+ "Task192552": "0$QGM+ZcuSQWGxY2IolngyVZy8sy4"
+ },
"inputFile": "task192552.h",
"outputRevision": 69
},
@@ -3228,6 +3392,10 @@
]
}
],
+ "hashes": {
+ "NS_A::NS_B::TestObject": "0$IMqa1PfGS0EaXXK+9Ch24g/nP2A",
+ "NS_A::NS_Main::TestMain": "0$0z3ZNVKocxpdZHzRFtoTKQimUm0"
+ },
"inputFile": "task234909.h",
"outputRevision": 69
},
@@ -3403,6 +3571,9 @@
]
}
],
+ "hashes": {
+ "TypenameWithUnsigned": "0$jwklF5QEzeV58Ui5C0aT9ZFwDVo"
+ },
"inputFile": "task240368.h",
"outputRevision": 69
},
@@ -3421,6 +3592,9 @@
]
}
],
+ "hashes": {
+ "Task87883": "0$wz5QuoSTJ+0peRmMDYqL9p8q5q4"
+ },
"inputFile": "task87883.h",
"outputRevision": 69
},
@@ -3507,6 +3681,9 @@
]
}
],
+ "hashes": {
+ "MyTechPreviewObject": "0$70fB9sh1BICrgFbeYIYRC8QX+PQ"
+ },
"inputFile": "tech-preview.h",
"outputRevision": 69
},
@@ -3591,6 +3768,9 @@
]
}
],
+ "hashes": {
+ "BBB::Foo": "0$QBU7ysZZuCx+IZ4+vUQEQ84tqu8"
+ },
"inputFile": "trigraphs.h",
"outputRevision": 69
},
diff --git a/tests/auto/tools/mochelpers/tst_mochelpers.cpp b/tests/auto/tools/mochelpers/tst_mochelpers.cpp
index 7e5d18d160e..ae80f0c2b58 100644
--- a/tests/auto/tools/mochelpers/tst_mochelpers.cpp
+++ b/tests/auto/tools/mochelpers/tst_mochelpers.cpp
@@ -104,7 +104,7 @@ void tst_MocHelpers::classinfoDataGroup()
{
constexpr auto data = QtMocHelpers::metaObjectData<void, void>(0, dummyStringData,
QtMocHelpers::UintData{}, QtMocHelpers::UintData{},
- QtMocHelpers::UintData{}, QtMocHelpers::UintData{},
+ QtMocHelpers::UintData{}, -1, QtMocHelpers::UintData{},
QtMocHelpers::ClassInfos({{1, 2}, {3, 4}}));
checkClassInfos(data.staticData.data);
}
@@ -612,7 +612,7 @@ void tst_MocHelpers::constructorUintGroup()
constexpr auto data = QtMocHelpers::metaObjectData<void, void>(0, dummyStringData,
QtMocHelpers::UintData{}, QtMocHelpers::UintData{},
- QtMocHelpers::UintData{}, constructors);
+ QtMocHelpers::UintData{}, -1, constructors);
checkConstructors(data.staticData.data, data.relocatingData.metaTypes);
}
@@ -676,7 +676,7 @@ void tst_MocHelpers::uintArrayNoMethods()
QtMocHelpers::EnumData<E2>(7, 6, EnumIsFlag | EnumIsScoped)
.add({ { 7, E2::V0 }, { 10, E2::V1 }, }),
QtMocHelpers::EnumData<QFlags<E1>>(11, 1, EnumIsFlag).add({ { 3, E1::AnEnumValue } }),
- }, QtMocHelpers::UintData{}, QtMocHelpers::ClassInfos({{1, 2}, {3, 4}}));
+ }, -1, QtMocHelpers::UintData{}, QtMocHelpers::ClassInfos({{1, 2}, {3, 4}}));
auto &data = mo.staticData.data;
auto &metaTypes = mo.relocatingData.metaTypes;
@@ -724,6 +724,7 @@ void tst_MocHelpers::uintArray()
.add({ { 7, E2::V0 }, { 10, E2::V1 }, }),
QtMocHelpers::EnumData<QFlags<E1>>(11, 1, EnumIsFlag).add({ { 3, E1::AnEnumValue } }),
},
+ -1,
QtMocHelpers::UintData{
QtMocHelpers::ConstructorData<NoType(QObject *)>(1, QtMocConstants::AccessPublic,
{{ { QMetaType::QObjectStar, 2 } }}
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 1f57ae43fae..50e8646499d 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -127,6 +127,7 @@ private slots:
#endif
void invisibleActions();
+ void execReturnsWidgetAction();
protected slots:
void onActivated(QAction*);
@@ -2335,5 +2336,26 @@ void tst_QMenu::dontSelectDisabledActionByShortcut()
}
#endif
+void tst_QMenu::execReturnsWidgetAction()
+{
+ QWidget window;
+
+ QMenu menu(&window);
+ QWidgetAction *widgetAction = new QWidgetAction(&menu);
+ QPushButton *menuButton = new QPushButton("Button", &menu);
+ widgetAction->setDefaultWidget(menuButton);
+ QObject::connect(menuButton, &QPushButton::clicked, widgetAction, &QAction::trigger);
+
+ menu.addAction("First");
+ menu.addAction(widgetAction);
+ menu.addAction("Last");
+
+ window.show();
+ QVERIFY(QTest::qWaitForWindowActive(&window));
+
+ QTimer::singleShot(0, menuButton, &QPushButton::click);
+ QCOMPARE(menu.exec(window.geometry().center()), widgetAction);
+}
+
QTEST_MAIN(tst_QMenu)
#include "tst_qmenu.moc"