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.

Pick-to: 6.5
Change-Id: I21b181e5563ebc2b247d6c5ad005bb76224f0daf
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Fabian Kosmale 2023-01-23 11:56:16 +01:00
parent 834e97ce46
commit 115a38613c
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -78,7 +78,7 @@ struct QMethodRawArguments
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
{
public:
@ -485,7 +485,7 @@ struct Q_CORE_EXPORT QMetaObject
#endif
#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0)
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
QObject *newInstance(QGenericArgument val0,
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),