diff options
-rw-r--r-- | src/corelib/global/qglobal.h | 34 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 5 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 5 | ||||
-rw-r--r-- | src/corelib/tools/qhashfunctions.h | 3 |
4 files changed, 46 insertions, 1 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index bbff1d2926..d077057aaa 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -95,6 +95,40 @@ # error Qt major version not 6 or 7 #endif +/* Macro and tag type to help overload resolution on functions + that are, e.g., QT_REMOVED_SINCE'ed. Example use: + + #if QT_CORE_REMOVED_SINCE(6, 4) + int size() const; + #endif + qsizetype size(QT6_DECL_NEW_OVERLOAD) const; + + in the normal cpp file: + + qsizetype size(QT6_IMPL_NEW_OVERLOAD) const { + ~~~ + } + + in removed_api.cpp: + + int size() const { return int(size(QT6_CALL_NEW_OVERLOAD)); } +*/ +#ifdef Q_CLANG_QDOC +# define QT6_DECL_NEW_OVERLOAD +# define QT6_DECL_NEW_OVERLOAD_TAIL +# define QT6_IMPL_NEW_OVERLOAD +# define QT6_IMPL_NEW_OVERLOAD_TAIL +# define QT6_CALL_NEW_OVERLOAD +# define QT6_CALL_NEW_OVERLOAD_TAIL +#else +# define QT6_DECL_NEW_OVERLOAD QT6_ONLY(Qt::Disambiguated_t = Qt::Disambiguated) +# define QT6_DECL_NEW_OVERLOAD_TAIL QT6_ONLY(, QT6_DECL_NEW_OVERLOAD) +# define QT6_IMPL_NEW_OVERLOAD QT6_ONLY(Qt::Disambiguated_t) +# define QT6_IMPL_NEW_OVERLOAD_TAIL QT6_ONLY(, QT6_IMPL_NEW_OVERLOAD) +# define QT6_CALL_NEW_OVERLOAD QT6_ONLY(Qt::Disambiguated) +# define QT6_CALL_NEW_OVERLOAD_TAIL QT6_ONLY(, QT_CALL_NEW_OVERLOAD) +#endif + /* These two macros makes it possible to turn the builtin line expander into a * string literal. */ #define QT_STRINGIFY2(x) #x diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index dd70e91a8f..5c8ed2e8e5 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1580,6 +1580,11 @@ namespace Qt { }; inline constexpr Initialization Uninitialized = Initialization::Uninitialized; + struct Disambiguated_t { + explicit Disambiguated_t() = default; + }; + inline constexpr Disambiguated_t Disambiguated{}; + enum CoordinateSystem { DeviceCoordinates, LogicalCoordinates diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 000001c1bf..23e3e9736b 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -3010,6 +3010,11 @@ */ /*! + \enum Qt::Disambiguated_t + \internal +*/ + +/*! \enum Qt::CoordinateSystem \since 4.6 diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h index 58f4afc94f..e9da071803 100644 --- a/src/corelib/tools/qhashfunctions.h +++ b/src/corelib/tools/qhashfunctions.h @@ -150,7 +150,8 @@ Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t qHash(const QByteArray &key, size_t se Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t qHash(const QByteArrayView &key, size_t seed = 0) noexcept; #else Q_CORE_EXPORT Q_DECL_PURE_FUNCTION size_t qHash(QByteArrayView key, size_t seed = 0) noexcept; -inline Q_DECL_PURE_FUNCTION size_t qHash(const QByteArray &key, size_t seed = 0 QT6_ONLY(, int = 0)) noexcept +inline Q_DECL_PURE_FUNCTION size_t qHash(const QByteArray &key, size_t seed = 0 + QT6_DECL_NEW_OVERLOAD_TAIL) noexcept { return qHash(qToByteArrayViewIgnoringNull(key), seed); } #endif |