Use QPointer instead of QWeakPointer to track QObjects.
The latter is to be deprecated. Change-Id: I01998be880feba0819a9bc51f9bec48fd4601789 Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
487010e579
commit
b93032a7df
@@ -46,6 +46,7 @@
|
||||
#include <QtCore/qrect.h>
|
||||
#include <QtCore/qsharedpointer.h>
|
||||
#include <QtQuick/qquickitem.h>
|
||||
#include <QtCore/qpointer.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@@ -125,9 +126,9 @@ private:
|
||||
|
||||
SourceType m_sourceType;
|
||||
|
||||
QWeakPointer<QObject> m_source;
|
||||
QWeakPointer<QMediaObject> m_mediaObject;
|
||||
QWeakPointer<QMediaService> m_service;
|
||||
QPointer<QObject> m_source;
|
||||
QPointer<QMediaObject> m_mediaObject;
|
||||
QPointer<QMediaService> m_service;
|
||||
|
||||
FillMode m_fillMode;
|
||||
QSize m_nativeSize;
|
||||
|
||||
@@ -69,13 +69,14 @@
|
||||
#include "qmediaservice.h"
|
||||
#include "qmediarecorder.h"
|
||||
#include "qsharedpointer.h"
|
||||
#include "qpointer.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAudioProbePrivate {
|
||||
public:
|
||||
QWeakPointer<QMediaObject> source;
|
||||
QWeakPointer<QMediaAudioProbeControl> probee;
|
||||
QPointer<QMediaObject> source;
|
||||
QPointer<QMediaAudioProbeControl> probee;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
#include <QtCore/qurl.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/QWeakPointer>
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
#include <qmediaplaylist.h>
|
||||
#include "qmediacontent.h"
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
QMediaResourceList resources;
|
||||
|
||||
QWeakPointer<QMediaPlaylist> playlist;
|
||||
QPointer<QMediaPlaylist> playlist;
|
||||
bool isPlaylistOwned;
|
||||
private:
|
||||
QMediaContentPrivate& operator=(const QMediaContentPrivate &other);
|
||||
|
||||
@@ -73,13 +73,14 @@
|
||||
#include "qmediaservice.h"
|
||||
#include "qmediarecorder.h"
|
||||
#include "qsharedpointer.h"
|
||||
#include "qpointer.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QVideoProbePrivate {
|
||||
public:
|
||||
QWeakPointer<QMediaObject> source;
|
||||
QWeakPointer<QMediaVideoProbeControl> probee;
|
||||
QPointer<QMediaObject> source;
|
||||
QPointer<QMediaVideoProbeControl> probee;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <qmediabindableinterface.h>
|
||||
|
||||
#include <QtCore/qsharedpointer.h>
|
||||
#include <QtCore/qpointer.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
@@ -72,10 +73,10 @@ protected:
|
||||
bool setMediaObject(QMediaObject *object);
|
||||
|
||||
private:
|
||||
QWeakPointer<QAbstractVideoSurface> m_surface;
|
||||
QWeakPointer<QVideoRendererControl> m_control;
|
||||
QWeakPointer<QMediaService> m_service;
|
||||
QWeakPointer<QMediaObject> m_object;
|
||||
QPointer<QAbstractVideoSurface> m_surface;
|
||||
QPointer<QVideoRendererControl> m_control;
|
||||
QPointer<QMediaService> m_service;
|
||||
QPointer<QMediaObject> m_object;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -181,7 +181,7 @@ void tst_QMediaContent::testPlaylist()
|
||||
QVERIFY(!media.playlist());
|
||||
|
||||
{
|
||||
QWeakPointer<QMediaPlaylist> playlist(new QMediaPlaylist);
|
||||
QPointer<QMediaPlaylist> playlist(new QMediaPlaylist);
|
||||
media = QMediaContent(playlist.data(), QUrl("http://example.com/sample.m3u"), true);
|
||||
QVERIFY(media.canonicalUrl().isValid());
|
||||
QCOMPARE(media.playlist(), playlist.data());
|
||||
@@ -200,7 +200,7 @@ void tst_QMediaContent::testPlaylist()
|
||||
}
|
||||
|
||||
{
|
||||
QWeakPointer<QMediaPlaylist> playlist(new QMediaPlaylist);
|
||||
QPointer<QMediaPlaylist> playlist(new QMediaPlaylist);
|
||||
media = QMediaContent(playlist.data(), QUrl(), false);
|
||||
QVERIFY(!media.canonicalUrl().isValid());
|
||||
QCOMPARE(media.playlist(), playlist.data());
|
||||
|
||||
Reference in New Issue
Block a user