diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 96299b9eaf..f77831c703 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -3896,7 +3896,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) \sa setValue(), value() */ -/*! \fn static inline QVariant fromStdVariant(const std::variant &value) +/*! \fn template QVariant QVariant::fromStdVariant(const std::variant &value) \since 5.11 Returns a QVariant with the type and value of the active variant of \a value. If diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index fe1ef1bdfc..7ce4e1a4d8 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -359,7 +359,7 @@ class Q_CORE_EXPORT QVariant static inline QVariant fromValue(const T &value) { return qVariantFromValue(value); } -#if QT_HAS_INCLUDE() && __cplusplus >= 201703L +#if defined(Q_CLANG_QDOC) || (QT_HAS_INCLUDE() && __cplusplus >= 201703L) template static inline QVariant fromStdVariant(const std::variant &value) {