QtPrivate::QSmartPointerConvertFunctor: Fix deprecation warning

Fix warning:
src/corelib/kernel/qmetatype.h:1723:27: warning: ‘T* QWeakPointer<T>::data() const [with T = QFile]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations]

shown when compiling tst_QVariant by using
QWeakPointer::internalData().

Change-Id: I5ea543019b4f8e5dfc829939cd2011ae65f12876
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Friedemann Kleint 2019-05-24 10:41:58 +02:00
parent 77e708d167
commit 28b06fc1a7
2 changed files with 2 additions and 1 deletions

View File

@ -1720,7 +1720,7 @@ namespace QtPrivate {
{
QObject* operator()(const QWeakPointer<T> &p) const
{
return p.data();
return p.internalData();
}
};
}

View File

@ -684,6 +684,7 @@ public:
template<typename X>
friend QPointer<X>
qPointerFromVariant(const QVariant &variant);
friend QtPrivate::QSmartPointerConvertFunctor<QWeakPointer>;
#endif
template <class X>