diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 23 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.h | 8 | ||||
-rw-r--r-- | src/corelib/global/qtdeprecationmarkers.h | 14 |
3 files changed, 39 insertions, 6 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 755a4c6c39..5b148dd42c 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -236,6 +236,19 @@ QLibraryInfo::isDebugBuild() noexcept } /*! + \since 6.5 + Returns \c true if this is a shared (dynamic) build of Qt. +*/ +bool QLibraryInfo::isSharedBuild() noexcept +{ +#ifdef QT_SHARED + return true; +#else + return false; +#endif +} + +/*! \since 5.8 Returns the version of the Qt library. @@ -646,15 +659,15 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) \deprecated Use LibraryPath with QLibraryInfo::path() instead. */ +#if QT_DEPRECATED_SINCE(6, 9) + bool qSharedBuild() noexcept { -#ifdef QT_SHARED - return true; -#else - return false; -#endif + return QLibraryInfo::isSharedBuild(); } +#endif // QT_DEPRECATED_SINCE(6, 9) + QT_END_NAMESPACE #if defined(Q_CC_GNU) && defined(ELF_INTERPRETER) diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index 8e6788d067..d4e8f8b050 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -15,7 +15,8 @@ class Q_CORE_EXPORT QLibraryInfo public: static const char *build() noexcept; - static bool isDebugBuild() noexcept Q_DECL_CONST_FUNCTION; + [[nodiscard]] static bool isDebugBuild() noexcept Q_DECL_CONST_FUNCTION; + [[nodiscard]] static bool isSharedBuild() noexcept Q_DECL_CONST_FUNCTION; #ifndef QT_BOOTSTRAPPED static QVersionNumber version() noexcept Q_DECL_CONST_FUNCTION; @@ -53,8 +54,13 @@ private: QLibraryInfo(); }; +#if QT_DEPRECATED_SINCE(6, 9) + +QT_DEPRECATED_VERSION_X_6_9("Use QLibraryInfo::isSharedBuild() instead.") Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() noexcept; +#endif + QT_END_NAMESPACE #endif // QLIBRARYINFO_H diff --git a/src/corelib/global/qtdeprecationmarkers.h b/src/corelib/global/qtdeprecationmarkers.h index cde9da3038..d3fa1d05bd 100644 --- a/src/corelib/global/qtdeprecationmarkers.h +++ b/src/corelib/global/qtdeprecationmarkers.h @@ -187,6 +187,14 @@ QT_BEGIN_NAMESPACE # define QT_DEPRECATED_VERSION_6_8 #endif +#if QT_WARN_DEPRECATED_UP_TO >= QT_VERSION_CHECK(6, 9, 0) +# define QT_DEPRECATED_VERSION_X_6_9(text) QT_DEPRECATED_X(text) +# define QT_DEPRECATED_VERSION_6_9 QT_DEPRECATED +#else +# define QT_DEPRECATED_VERSION_X_6_9(text) +# define QT_DEPRECATED_VERSION_6_9 +#endif + #define QT_DEPRECATED_VERSION_X_5(minor, text) QT_DEPRECATED_VERSION_X_5_##minor(text) #define QT_DEPRECATED_VERSION_X(major, minor, text) QT_DEPRECATED_VERSION_X_##major##_##minor(text) @@ -277,6 +285,12 @@ QT_BEGIN_NAMESPACE # define QT_IF_DEPRECATED_SINCE_6_8(whenTrue, whenFalse) whenTrue #endif +#if QT_DEPRECATED_SINCE(6, 9) +# define QT_IF_DEPRECATED_SINCE_6_9(whenTrue, whenFalse) whenFalse +#else +# define QT_IF_DEPRECATED_SINCE_6_9(whenTrue, whenFalse) whenTrue +#endif + #ifdef __cplusplus // A tag to help mark stuff deprecated (cf. QStringViewLiteral) namespace QtPrivate { |