diff options
author | Tasuku Suzuki <tasuku.suzuki@nokia.com> | 2010-04-13 11:22:01 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2010-04-15 11:05:19 (GMT) |
commit | 97caf6916a830b70f6a40a99a55fd4500b163c37 (patch) | |
tree | 8d362f83a130550cb40ecaa5a911abd598c284e3 /src/multimedia | |
parent | 63224660526b199eabd08e1dfbd8956e764d768e (diff) | |
download | Qt-97caf6916a830b70f6a40a99a55fd4500b163c37.zip Qt-97caf6916a830b70f6a40a99a55fd4500b163c37.tar.gz Qt-97caf6916a830b70f6a40a99a55fd4500b163c37.tar.bz2 |
Fix compile error with QT_NO_GRAPHICSVIEW in QtMultimedia
Merge-request: 2333
Reviewed-by: Thierry Bastian <thierry.bastian@nokia.com>
Diffstat (limited to 'src/multimedia')
-rw-r--r-- | src/multimedia/base/qgraphicsvideoitem.cpp | 5 | ||||
-rw-r--r-- | src/multimedia/base/qgraphicsvideoitem.h | 3 | ||||
-rw-r--r-- | src/multimedia/playback/qmediaplayer.cpp | 16 |
3 files changed, 23 insertions, 1 deletions
diff --git a/src/multimedia/base/qgraphicsvideoitem.cpp b/src/multimedia/base/qgraphicsvideoitem.cpp index f903eb7..c50d3ff 100644 --- a/src/multimedia/base/qgraphicsvideoitem.cpp +++ b/src/multimedia/base/qgraphicsvideoitem.cpp @@ -52,6 +52,8 @@ #include <QtOpenGL/qgl.h> #endif +#ifndef QT_NO_GRAPHICSVIEW + QT_BEGIN_NAMESPACE @@ -434,4 +436,7 @@ bool QGraphicsVideoItem::sceneEvent(QEvent *event) } QT_END_NAMESPACE + +#endif // QT_NO_GRAPHICSVIEW + #include "moc_qgraphicsvideoitem.cpp" diff --git a/src/multimedia/base/qgraphicsvideoitem.h b/src/multimedia/base/qgraphicsvideoitem.h index e6f0d81..a20caf3 100644 --- a/src/multimedia/base/qgraphicsvideoitem.h +++ b/src/multimedia/base/qgraphicsvideoitem.h @@ -46,6 +46,7 @@ #include <QtMultimedia/qvideowidget.h> +#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW QT_BEGIN_HEADER @@ -109,4 +110,6 @@ QT_END_NAMESPACE QT_END_HEADER +#endif // QT_NO_GRAPHICSVIEW + #endif diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index 9466cad..6b2e0f9 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -145,7 +145,9 @@ public: QMediaPlaylist *playlist; QPointer<QVideoWidget> videoWidget; +#ifndef QT_NO_GRAPHICSVIEW QPointer<QGraphicsVideoItem> videoItem; +#endif void _q_stateChanged(QMediaPlayer::State state); void _q_mediaStatusChanged(QMediaPlayer::MediaStatus status); @@ -618,26 +620,36 @@ void QMediaPlayer::bind(QObject *obj) } QVideoWidget *videoWidget = qobject_cast<QVideoWidget*>(obj); +#ifndef QT_NO_GRAPHICSVIEW QGraphicsVideoItem *videoItem = qobject_cast<QGraphicsVideoItem*>(obj); +#endif - if (videoWidget || videoItem) { + if (videoWidget +#ifndef QT_NO_GRAPHICSVIEW + || videoItem +#endif + ) { //detach the current video output if (d->videoWidget) { d->videoWidget->setMediaObject(0); d->videoWidget = 0; } +#ifndef QT_NO_GRAPHICSVIEW if (d->videoItem) { d->videoItem->setMediaObject(0); d->videoItem = 0; } +#endif } if (videoWidget) d->videoWidget = videoWidget; +#ifndef QT_NO_GRAPHICSVIEW if (videoItem) d->videoItem = videoItem; +#endif } } @@ -651,8 +663,10 @@ void QMediaPlayer::unbind(QObject *obj) if (obj == d->videoWidget) { d->videoWidget = 0; +#ifndef QT_NO_GRAPHICSVIEW } else if (obj == d->videoItem) { d->videoItem = 0; +#endif } else if (obj == d->playlist) { disconnect(d->playlist, SIGNAL(currentMediaChanged(QMediaContent)), this, SLOT(_q_updateMedia(QMediaContent))); |