diff options
-rw-r--r-- | cmake/modulecppexports.h.in | 14 | ||||
-rw-r--r-- | src/corelib/compat/removed_api.cpp | 1 | ||||
-rw-r--r-- | src/corelib/text/qlocale.cpp | 2 | ||||
-rw-r--r-- | src/corelib/text/qlocale.h | 6 |
4 files changed, 22 insertions, 1 deletions
diff --git a/cmake/modulecppexports.h.in b/cmake/modulecppexports.h.in index a126dea0ec..a2c2155720 100644 --- a/cmake/modulecppexports.h.in +++ b/cmake/modulecppexports.h.in @@ -16,6 +16,20 @@ # define Q_@module_define_infix@_EXPORT #endif +#if !defined(QT_BUILD_@module_define_infix@_LIB) || defined(QT_STATIC) +/* outside library → inline decl + defi */ +# define QT_@module_define_infix@_INLINE_SINCE(major, minor) inline +# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1 +#elif defined(QT_@module_define_infix@_BUILD_REMOVED_API) +/* inside library, inside removed_api.cpp → non-inline decl, defi */ +# define QT_@module_define_infix@_INLINE_SINCE(major, minor) /* not inline */ +# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1 +#else +/* inside library, outside removed_api.cpp → non-inline decl, no defi */ +# define QT_@module_define_infix@_INLINE_SINCE(major, minor) /* not inline */ +# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 0 +#endif + #ifdef QT_@module_define_infix@_BUILD_REMOVED_API # define QT_@module_define_infix@_REMOVED_SINCE(major, minor) QT_DEPRECATED_SINCE(major, minor) #else diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index 2b00142954..87dbe3c916 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -189,6 +189,7 @@ void QObject::setObjectName(const QString &name) setObjectName<void>(name); } +#include "qlocale.h" // uses QT_CORE_INLINE_SINCE #include "qsettings.h" diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 7993c2139d..811df6dcdc 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -996,9 +996,9 @@ QLocale::QLocale(QStringView name) #if QT_STRINGVIEW_LEVEL < 2 /*! + \fn QLocale::QLocale(const QString &name) \overload */ -QLocale::QLocale(const QString &name) : QLocale(qToStringViewIgnoringNull(name)) {} #endif /*! diff --git a/src/corelib/text/qlocale.h b/src/corelib/text/qlocale.h index 5ba29f6093..b9880496f1 100644 --- a/src/corelib/text/qlocale.h +++ b/src/corelib/text/qlocale.h @@ -892,6 +892,7 @@ public: QLocale(); #if QT_STRINGVIEW_LEVEL < 2 + QT_CORE_INLINE_SINCE(6, 4) explicit QLocale(const QString &name); #endif explicit QLocale(QStringView name); @@ -1133,6 +1134,11 @@ Q_DECLARE_SHARED(QLocale) Q_DECLARE_OPERATORS_FOR_FLAGS(QLocale::NumberOptions) Q_DECLARE_OPERATORS_FOR_FLAGS(QLocale::LanguageCodeTypes) +#if QT_CORE_INLINE_IMPL_SINCE(6, 4) +QLocale::QLocale(const QString &name) + : QLocale(qToStringViewIgnoringNull(name)) {} +#endif + #ifndef QT_NO_DATASTREAM Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QLocale &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QLocale &); |