QMetaObject: Fix version check for deprecated methods

We don't want them in Qt 7.0.0, either.
As a drive-by, also guard the implementation with the same check.

Change-Id: I21b181e5563ebc2b247d6c5ad005bb76224f0daf
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 115a38613c0ed0ea1d6c82d927809074cb69f385)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Fabian Kosmale 2023-01-23 11:56:16 +01:00 committed by Qt Cherry-pick Bot
parent 1bfa58f11c
commit 3192d46c39
2 changed files with 4 additions and 2 deletions

View File

@ -199,6 +199,7 @@ private:
enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
/*! /*!
\since 4.5 \since 4.5
\obsolete [6.5] Please use the variadic overload of this function \obsolete [6.5] Please use the variadic overload of this function
@ -244,6 +245,7 @@ QObject *QMetaObject::newInstance(QGenericArgument val0,
return newInstanceImpl(this, paramCount, parameters, typeNames, nullptr); return newInstanceImpl(this, paramCount, parameters, typeNames, nullptr);
} }
#endif
/*! /*!
\fn template <typename... Args> QObject *QMetaObject::newInstance(Args &&... arguments) const \fn template <typename... Args> QObject *QMetaObject::newInstance(Args &&... arguments) const

View File

@ -78,7 +78,7 @@ struct QMethodRawArguments
void **arguments; void **arguments;
}; };
#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
class Q_CORE_EXPORT QGenericArgument class Q_CORE_EXPORT QGenericArgument
{ {
public: public:
@ -485,7 +485,7 @@ struct Q_CORE_EXPORT QMetaObject
#endif #endif
#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
QObject *newInstance(QGenericArgument val0, QObject *newInstance(QGenericArgument val0,
QGenericArgument val1 = QGenericArgument(), QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(),