From 6ffb4e1e8d56d1fab58fcaa369afde33fd983c1f Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Tue, 23 Feb 2010 11:07:22 +1000 Subject: Add private header warning. Reviewed-by: Kurt Korbatits --- src/multimedia/qml/qmetadatacontrolmetaobject_p.h | 11 +++++++++++ src/multimedia/qml/qmlaudio_p.h | 11 +++++++++++ src/multimedia/qml/qmlgraphicsvideo_p.h | 11 +++++++++++ src/multimedia/qml/qmlmediabase_p.h | 10 ++++++++++ src/multimedia/qml/wavedecoder_p.h | 11 +++++++++++ 5 files changed, 54 insertions(+) diff --git a/src/multimedia/qml/qmetadatacontrolmetaobject_p.h b/src/multimedia/qml/qmetadatacontrolmetaobject_p.h index c0fd4e8..ec4df05 100644 --- a/src/multimedia/qml/qmetadatacontrolmetaobject_p.h +++ b/src/multimedia/qml/qmetadatacontrolmetaobject_p.h @@ -42,6 +42,17 @@ #ifndef QMETADATACONTROLMETAOBJECT_P_H #define QMETADATACONTROLMETAOJBECT_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include diff --git a/src/multimedia/qml/qmlaudio_p.h b/src/multimedia/qml/qmlaudio_p.h index f034518..bb0d301 100644 --- a/src/multimedia/qml/qmlaudio_p.h +++ b/src/multimedia/qml/qmlaudio_p.h @@ -42,6 +42,17 @@ #ifndef QMLAUDIO_P_H #define QMLAUDIO_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include diff --git a/src/multimedia/qml/qmlgraphicsvideo_p.h b/src/multimedia/qml/qmlgraphicsvideo_p.h index a4f8e32..26252e0 100644 --- a/src/multimedia/qml/qmlgraphicsvideo_p.h +++ b/src/multimedia/qml/qmlgraphicsvideo_p.h @@ -42,6 +42,17 @@ #ifndef QMLGRAPHICSVIDEO_H #define QMLGRAPHICSVIDEO_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include diff --git a/src/multimedia/qml/qmlmediabase_p.h b/src/multimedia/qml/qmlmediabase_p.h index 948a0e8..d6ad9b3 100644 --- a/src/multimedia/qml/qmlmediabase_p.h +++ b/src/multimedia/qml/qmlmediabase_p.h @@ -42,6 +42,16 @@ #ifndef QMLMEDIABASE_P_H #define QMLMEDIABASE_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// #include #include diff --git a/src/multimedia/qml/wavedecoder_p.h b/src/multimedia/qml/wavedecoder_p.h index 3bcd90d..00aa14e 100644 --- a/src/multimedia/qml/wavedecoder_p.h +++ b/src/multimedia/qml/wavedecoder_p.h @@ -42,6 +42,17 @@ #ifndef WAVEDECODER_H #define WAVEDECODER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include -- cgit v0.12 From 4b1a9e65bb989e7edcaa0bc0be9924885e7e06c9 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Tue, 23 Feb 2010 11:34:30 +1000 Subject: Change qml.{h,cpp} -> multimediaqml.{h,cpp} in QtMultimedia. Reviewed-by: Nicholas Young --- src/multimedia/qml/multimediaqml.cpp | 68 ++++++++++++++++++++++++ src/multimedia/qml/multimediaqml.h | 60 +++++++++++++++++++++ src/multimedia/qml/qml.cpp | 68 ------------------------ src/multimedia/qml/qml.h | 60 --------------------- src/multimedia/qml/qml.pri | 4 +- src/plugins/qmlmodules/multimedia/multimedia.cpp | 2 +- 6 files changed, 131 insertions(+), 131 deletions(-) create mode 100644 src/multimedia/qml/multimediaqml.cpp create mode 100644 src/multimedia/qml/multimediaqml.h delete mode 100644 src/multimedia/qml/qml.cpp delete mode 100644 src/multimedia/qml/qml.h diff --git a/src/multimedia/qml/multimediaqml.cpp b/src/multimedia/qml/multimediaqml.cpp new file mode 100644 index 0000000..be49915 --- /dev/null +++ b/src/multimedia/qml/multimediaqml.cpp @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + + +QT_BEGIN_NAMESPACE + +namespace QtMultimedia +{ + +/*! + Register the Multimedia QML elements. + \internal +*/ + +void qRegisterQmlElements() +{ + qmlRegisterType("Qt.multimedia", 4, 7, "SoundEffect", "SoundEffect"); + qmlRegisterType("Qt.multimedia", 4, 7, "Audio", "Audio"); + qmlRegisterType("Qt.multimedia", 4, 7, "Video", "Video"); +} + +} + +QT_END_NAMESPACE + diff --git a/src/multimedia/qml/multimediaqml.h b/src/multimedia/qml/multimediaqml.h new file mode 100644 index 0000000..41274c8 --- /dev/null +++ b/src/multimedia/qml/multimediaqml.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTMULTIMEDIA_QML_H +#define QTMULTIMEDIA_QML_H + +#include + +QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +namespace QtMultimedia +{ +extern void Q_MULTIMEDIA_EXPORT qRegisterQmlElements(); +} + +QT_END_NAMESPACE +QT_END_HEADER + +#endif // ifndef QTMULTIMEDIA_QML_H diff --git a/src/multimedia/qml/qml.cpp b/src/multimedia/qml/qml.cpp deleted file mode 100644 index b9ee212..0000000 --- a/src/multimedia/qml/qml.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtMultimedia module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include - - -QT_BEGIN_NAMESPACE - -namespace QtMultimedia -{ - -/*! - Register the Multimedia QML elements. - \internal -*/ - -void qRegisterQmlElements() -{ - qmlRegisterType("Qt.multimedia", 4, 7, "SoundEffect", "SoundEffect"); - qmlRegisterType("Qt.multimedia", 4, 7, "Audio", "Audio"); - qmlRegisterType("Qt.multimedia", 4, 7, "Video", "Video"); -} - -} - -QT_END_NAMESPACE - diff --git a/src/multimedia/qml/qml.h b/src/multimedia/qml/qml.h deleted file mode 100644 index 41274c8..0000000 --- a/src/multimedia/qml/qml.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtMultimedia module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTMULTIMEDIA_QML_H -#define QTMULTIMEDIA_QML_H - -#include - -QT_BEGIN_HEADER -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -namespace QtMultimedia -{ -extern void Q_MULTIMEDIA_EXPORT qRegisterQmlElements(); -} - -QT_END_NAMESPACE -QT_END_HEADER - -#endif // ifndef QTMULTIMEDIA_QML_H diff --git a/src/multimedia/qml/qml.pri b/src/multimedia/qml/qml.pri index e506632..a7ca02e 100644 --- a/src/multimedia/qml/qml.pri +++ b/src/multimedia/qml/qml.pri @@ -17,7 +17,7 @@ contains(QT_CONFIG, declarative) { } HEADERS += \ - $$PWD/qml.h \ + $$PWD/multimediaqml.h \ $$PWD/qmetadatacontrolmetaobject_p.h \ $$PWD/qmlaudio_p.h \ $$PWD/qmlgraphicsvideo_p.h \ @@ -26,7 +26,7 @@ contains(QT_CONFIG, declarative) { $$PWD/wavedecoder_p.h SOURCES += \ - $$PWD/qml.cpp \ + $$PWD/multimediaqml.cpp \ $$PWD/qmetadatacontrolmetaobject.cpp \ $$PWD/qmlaudio.cpp \ $$PWD/qmlgraphicsvideo.cpp \ diff --git a/src/plugins/qmlmodules/multimedia/multimedia.cpp b/src/plugins/qmlmodules/multimedia/multimedia.cpp index d9414ee..d192ed8 100644 --- a/src/plugins/qmlmodules/multimedia/multimedia.cpp +++ b/src/plugins/qmlmodules/multimedia/multimedia.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From f56a36d771bb71fe6d0f7025ae427a76a1d22324 Mon Sep 17 00:00:00 2001 From: Nicholas Young Date: Tue, 23 Feb 2010 13:32:23 +1000 Subject: Added QNetworkRequest constructor to QMediaContent. Now consistent with QMediaResource. Reviewed-by: Dmytro Poplavskiy --- src/multimedia/base/qmediacontent.cpp | 13 +++++++++++++ src/multimedia/base/qmediacontent.h | 2 ++ tests/auto/qmediacontent/tst_qmediacontent.cpp | 13 +++++++++++++ 3 files changed, 28 insertions(+) diff --git a/src/multimedia/base/qmediacontent.cpp b/src/multimedia/base/qmediacontent.cpp index 3e32af0..fd519c6 100644 --- a/src/multimedia/base/qmediacontent.cpp +++ b/src/multimedia/base/qmediacontent.cpp @@ -109,6 +109,19 @@ QMediaContent::QMediaContent(const QUrl &url): } /*! + Constructs a media content with \a request providing a reference to the content. + + This constructor can be used to reference media content via network protocols such as HTTP. + This may include additional information required to obtain the resource, such as Cookies or HTTP headers. +*/ + +QMediaContent::QMediaContent(const QNetworkRequest &request): + d(new QMediaContentPrivate) +{ + d->resources << QMediaResource(request); +} + +/*! Constructs a media content with \a resource providing a reference to the content. */ diff --git a/src/multimedia/base/qmediacontent.h b/src/multimedia/base/qmediacontent.h index 1ea4898..b6f3017 100644 --- a/src/multimedia/base/qmediacontent.h +++ b/src/multimedia/base/qmediacontent.h @@ -46,6 +46,7 @@ #include #include +#include QT_BEGIN_HEADER @@ -60,6 +61,7 @@ class Q_MULTIMEDIA_EXPORT QMediaContent public: QMediaContent(); QMediaContent(const QUrl &contentUrl); + QMediaContent(const QNetworkRequest &contentRequest); QMediaContent(const QMediaResource &contentResource); QMediaContent(const QMediaResourceList &resources); QMediaContent(const QMediaContent &other); diff --git a/tests/auto/qmediacontent/tst_qmediacontent.cpp b/tests/auto/qmediacontent/tst_qmediacontent.cpp index 35dd0a9..8987241 100644 --- a/tests/auto/qmediacontent/tst_qmediacontent.cpp +++ b/tests/auto/qmediacontent/tst_qmediacontent.cpp @@ -51,6 +51,7 @@ class tst_QMediaContent : public QObject private slots: void testNull(); void testUrlCtor(); + void testRequestCtor(); void testResourceCtor(); void testResourceListCtor(); void testCopy(); @@ -77,6 +78,18 @@ void tst_QMediaContent::testUrlCtor() QCOMPARE(media.canonicalResource().url(), QUrl("http://example.com/movie.mov")); } +void tst_QMediaContent::testRequestCtor() +{ + QNetworkRequest request(QUrl("http://example.com/movie.mov")); + request.setAttribute(QNetworkRequest::User, QVariant(1234)); + + QMediaContent media(request); + + QCOMPARE(media.canonicalUrl(), QUrl("http://example.com/movie.mov")); + QCOMPARE(media.canonicalResource().request(), request); + QCOMPARE(media.canonicalResource().url(), QUrl("http://example.com/movie.mov")); +} + void tst_QMediaContent::testResourceCtor() { QMediaContent media(QMediaResource(QUrl("http://example.com/movie.mov"))); -- cgit v0.12 From 0b4e388d88af73c9f542289d40b261cd32116380 Mon Sep 17 00:00:00 2001 From: Nicholas Young Date: Tue, 23 Feb 2010 14:52:03 +1000 Subject: Player demo updated with more user-friendly previous button behaviour. Pressing previous within the first five seconds will go to the previous item in the playlist. Otherwise, it will seek to the beginning of the current item. Reviewed-by: Kurt Korbatits --- demos/multimedia/player/player.cpp | 12 +++++++++++- demos/multimedia/player/player.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/demos/multimedia/player/player.cpp b/demos/multimedia/player/player.cpp index 64b1f25..49d18cb 100644 --- a/demos/multimedia/player/player.cpp +++ b/demos/multimedia/player/player.cpp @@ -99,7 +99,7 @@ Player::Player(QWidget *parent) connect(controls, SIGNAL(pause()), player, SLOT(pause())); connect(controls, SIGNAL(stop()), player, SLOT(stop())); connect(controls, SIGNAL(next()), playlist, SLOT(next())); - connect(controls, SIGNAL(previous()), playlist, SLOT(previous())); + connect(controls, SIGNAL(previous()), this, SLOT(previousClicked())); connect(controls, SIGNAL(changeVolume(int)), player, SLOT(setVolume(int))); connect(controls, SIGNAL(changeMuting(bool)), player, SLOT(setMuted(bool))); connect(controls, SIGNAL(changeRate(qreal)), player, SLOT(setPlaybackRate(qreal))); @@ -200,6 +200,16 @@ void Player::metaDataChanged() } } +void Player::previousClicked() +{ + // Go to previous track if we are within the first 5 seconds of playback + // Otherwise, seek to the beginning. + if(player->position() <= 5000) + playlist->previous(); + else + player->setPosition(0); +} + void Player::jump(const QModelIndex &index) { if (index.isValid()) { diff --git a/demos/multimedia/player/player.h b/demos/multimedia/player/player.h index 0ad609b..1de8b1a 100644 --- a/demos/multimedia/player/player.h +++ b/demos/multimedia/player/player.h @@ -77,6 +77,8 @@ private slots: void positionChanged(qint64 progress); void metaDataChanged(); + void previousClicked(); + void seek(int seconds); void jump(const QModelIndex &index); void playlistPositionChanged(int); -- cgit v0.12 From 4325feb3b93a7676e0b2d0301b8a17f69ffa7c1e Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Tue, 23 Feb 2010 15:10:03 +1000 Subject: Remove active qDebugs. Change to qWarning where appropriate, otherwise comment Reviewed-by: Dmytro Poplavskiy --- .../mediaservices/directshow/dsserviceplugin.cpp | 2 +- .../directshow/mediaplayer/directshowiosource.cpp | 4 ---- .../mediaplayer/qgstreamermetadataprovider.cpp | 2 +- .../gstreamer/qgstreamerserviceplugin.cpp | 7 +++--- .../qgstreamervideoinputdevicecontrol.cpp | 4 ++-- .../mediaservices/gstreamer/qgstxvimagebuffer.cpp | 4 ++-- .../gstreamer/qvideosurfacegstsink.cpp | 3 +-- .../qt7/mediaplayer/qt7playerservice.mm | 8 +++---- .../qt7/mediaplayer/qt7playersession.mm | 6 +++--- src/plugins/mediaservices/qt7/qt7movierenderer.mm | 25 +++++++++++----------- .../mediaservices/qt7/qt7movievideowidget.mm | 4 ++-- .../mediaservices/qt7/qt7movieviewrenderer.mm | 11 +++++----- 12 files changed, 38 insertions(+), 42 deletions(-) diff --git a/src/plugins/mediaservices/directshow/dsserviceplugin.cpp b/src/plugins/mediaservices/directshow/dsserviceplugin.cpp index f3ab889..c482fd5 100644 --- a/src/plugins/mediaservices/directshow/dsserviceplugin.cpp +++ b/src/plugins/mediaservices/directshow/dsserviceplugin.cpp @@ -94,7 +94,7 @@ QMediaService* DSServicePlugin::create(QString const& key) return new DirectShowPlayerService; #endif - qDebug() << "unsupported key:" << key; + qWarning() << "DirectShow service plugin: unsupported service -" << key; return 0; } diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp index c2fb0d4..1dca465 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp @@ -624,11 +624,7 @@ bool DirectShowRcSource::open(const QUrl &url) m_file.setFileName(QLatin1Char(':') + url.path()); - qDebug("qrc file %s", qPrintable(m_file.fileName())); - if (m_file.open(QIODevice::ReadOnly)) { - qDebug("Size %d", m_file.size()); - qDebug("Sequential %d", int(m_file.isSequential())); setDevice(&m_file); diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp index 49eeb23..4d0ffe4 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp @@ -41,7 +41,7 @@ #include "qgstreamermetadataprovider.h" #include "qgstreamerplayersession.h" -#include +#include #include diff --git a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp index 9e5f425..589d2b5 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #include "qgstreamerserviceplugin.h" @@ -99,7 +98,7 @@ QMediaService* QGstreamerServicePlugin::create(const QString &key) return new QGstreamerCaptureService(key); #endif - qDebug() << "unsupported key:" << key; + qWarning() << "GStreamer service plugin: unsupported service -" << key; return 0; } @@ -145,7 +144,7 @@ void QGstreamerServicePlugin::updateDevices() const QFileInfoList entries = devDir.entryInfoList(QStringList() << "video*"); foreach( const QFileInfo &entryInfo, entries ) { - qDebug() << "Try" << entryInfo.filePath(); +// qDebug() << "Try" << entryInfo.filePath(); int fd = ::open(entryInfo.filePath().toLatin1().constData(), O_RDWR ); if (fd == -1) @@ -172,7 +171,7 @@ void QGstreamerServicePlugin::updateDevices() const name = entryInfo.fileName(); else name = QString((const char*)vcap.card); - qDebug() << "found camera: " << name; +// qDebug() << "found camera: " << name; m_cameraDevices.append(entryInfo.filePath().toLocal8Bit()); m_cameraDescriptions.append(name); diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp index ac9a1e3..94ae847 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp @@ -120,7 +120,7 @@ void QGstreamerVideoInputDeviceControl::update() QFileInfoList entries = devDir.entryInfoList(QStringList() << "video*"); foreach( const QFileInfo &entryInfo, entries ) { - qDebug() << "Try" << entryInfo.filePath(); +// qDebug() << "Try" << entryInfo.filePath(); int fd = ::open(entryInfo.filePath().toLatin1().constData(), O_RDWR ); if (fd == -1) @@ -147,7 +147,7 @@ void QGstreamerVideoInputDeviceControl::update() name = entryInfo.fileName(); else name = QString((const char*)vcap.card); - qDebug() << "found camera: " << name; +// qDebug() << "found camera: " << name; m_names.append(entryInfo.filePath()); m_descriptions.append(name); diff --git a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp index 0e47c98..5b99817 100644 --- a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp @@ -182,7 +182,7 @@ void QGstXvImageBufferPool::queuedAlloc() ); if (!xvBuffer->xvImage) { - qDebug() << "QGstXvImageBufferPool: XvShmCreateImage failed"; +// qDebug() << "QGstXvImageBufferPool: XvShmCreateImage failed"; m_allocWaitCondition.wakeOne(); return; } @@ -192,7 +192,7 @@ void QGstXvImageBufferPool::queuedAlloc() xvBuffer->shmInfo.readOnly = False; if (!XShmAttach(QX11Info::display(), &xvBuffer->shmInfo)) { - qDebug() << "QGstXvImageBufferPool: XShmAttach failed"; +// qDebug() << "QGstXvImageBufferPool: XShmAttach failed"; m_allocWaitCondition.wakeOne(); return; } diff --git a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp index 9e3807b..402a225 100644 --- a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp +++ b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp @@ -41,9 +41,8 @@ #include #include -#include +#include #include -#include #include #include diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm index df15fa8..faf75d1 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm @@ -79,7 +79,7 @@ QT7PlayerService::QT7PlayerService(QObject *parent): #if defined(QT_MAC_USE_COCOA) m_videoWidnowControl = new QT7MovieViewOutput(this); m_videoOutputControl->enableOutput(QVideoOutputControl::WindowOutput); - qDebug() << "Using cocoa"; +// qDebug() << "Using cocoa"; #endif #ifdef QUICKTIME_C_API_AVAILABLE @@ -88,11 +88,11 @@ QT7PlayerService::QT7PlayerService(QObject *parent): m_videoWidgetControl = new QT7MovieVideoWidget(this); m_videoOutputControl->enableOutput(QVideoOutputControl::WidgetOutput); - qDebug() << "QuickTime C API is available"; +// qDebug() << "QuickTime C API is available"; #else m_videoRendererControl = new QT7MovieViewRenderer(this); m_videoOutputControl->enableOutput(QVideoOutputControl::RendererOutput); - qDebug() << "QuickTime C API is not available"; +// qDebug() << "QuickTime C API is not available"; #endif @@ -129,7 +129,7 @@ QMediaControl *QT7PlayerService::control(const char *name) const void QT7PlayerService::updateVideoOutput() { - qDebug() << "QT7PlayerService::updateVideoOutput" << m_videoOutputControl->output(); +// qDebug() << "QT7PlayerService::updateVideoOutput" << m_videoOutputControl->output(); switch (m_videoOutputControl->output()) { case QVideoOutputControl::WindowOutput: diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm index 5507633..b5561f7 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm @@ -373,7 +373,7 @@ void QT7PlayerSession::setMedia(const QMediaContent &content, QIODevice *stream) else return; - qDebug() << "Open media" << url; +// qDebug() << "Open media" << url; NSError *err = 0; NSString *urlString = (NSString *)qString2CFStringRef(url.toString()); @@ -437,7 +437,7 @@ void QT7PlayerSession::processStateChange() { signed long state = [[(QTMovie*)m_QTMovie attributeForKey:QTMovieLoadStateAttribute] longValue]; - qDebug() << "Moview load state changed:" << state; +// qDebug() << "Moview load state changed:" << state; #ifndef QUICKTIME_C_API_AVAILABLE enum { @@ -506,7 +506,7 @@ void QT7PlayerSession::processNaturalSizeChange() { if (m_videoOutput) { NSSize size = [[(QTMovie*)m_QTMovie attributeForKey:@"QTMovieNaturalSizeAttribute"] sizeValue]; - qDebug() << "Native size changed:" << QSize(size.width, size.height); +// qDebug() << "Native size changed:" << QSize(size.width, size.height); m_videoOutput->updateNaturalSize(QSize(size.width, size.height)); } } diff --git a/src/plugins/mediaservices/qt7/qt7movierenderer.mm b/src/plugins/mediaservices/qt7/qt7movierenderer.mm index 587f3b9..6b9fd21 100644 --- a/src/plugins/mediaservices/qt7/qt7movierenderer.mm +++ b/src/plugins/mediaservices/qt7/qt7movierenderer.mm @@ -169,7 +169,7 @@ QT7MovieRenderer::QT7MovieRenderer(QObject *parent) #endif m_surface(0) { - qDebug() << "QT7MovieRenderer"; +// qDebug() << "QT7MovieRenderer"; m_displayLink = new QCvDisplayLink(this); connect(m_displayLink, SIGNAL(tick(CVTimeStamp)), SLOT(updateVideoFrame(CVTimeStamp))); @@ -262,7 +262,7 @@ void QT7MovieRenderer::setupVideoOutput() { AutoReleasePool pool; - qDebug() << "QT7MovieRenderer::setupVideoOutput" << m_movie; +// qDebug() << "QT7MovieRenderer::setupVideoOutput" << m_movie; if (m_movie == 0 || m_surface == 0) { m_displayLink->stop(); @@ -286,9 +286,9 @@ void QT7MovieRenderer::setupVideoOutput() if (m_surface->isActive()) m_surface->stop(); - qDebug() << "Starting the surface with format" << format; +// qDebug() << "Starting the surface with format" << format; if (!m_surface->start(format)) { - qDebug() << "failed to start video surface" << m_surface->error(); +// qDebug() << "failed to start video surface" << m_surface->error(); glSupported = false; } else { m_usingGLContext = true; @@ -301,14 +301,15 @@ void QT7MovieRenderer::setupVideoOutput() QVideoSurfaceFormat format(m_nativeSize, QVideoFrame::Format_RGB32); if (m_surface->isActive() && m_surface->surfaceFormat() != format) { - qDebug() << "Surface format was changed, stop the surface."; +// qDebug() << "Surface format was changed, stop the surface."; m_surface->stop(); } if (!m_surface->isActive()) { - qDebug() << "Starting the surface with format" << format; - if (!m_surface->start(format)) - qDebug() << "failed to start video surface" << m_surface->error(); +// qDebug() << "Starting the surface with format" << format; + m_surface->start(format); +// if (!m_surface->start(format)) +// qDebug() << "failed to start video surface" << m_surface->error(); } } } @@ -328,14 +329,14 @@ void QT7MovieRenderer::setupVideoOutput() if (!m_nativeSize.isEmpty()) { if (!m_visualContext) { if (m_usingGLContext) { - qDebug() << "Building OpenGL visual context" << m_nativeSize; +// qDebug() << "Building OpenGL visual context" << m_nativeSize; m_currentGLContext = QGLContext::currentContext(); if (!createGLVisualContext()) { qWarning() << "QT7MovieRenderer: failed to create visual context"; return; } } else { - qDebug() << "Building Pixel Buffer visual context" << m_nativeSize; +// qDebug() << "Building Pixel Buffer visual context" << m_nativeSize; if (!createPixelBufferVisualContext()) { qWarning() << "QT7MovieRenderer: failed to create visual context"; return; @@ -358,7 +359,7 @@ void QT7MovieRenderer::setEnabled(bool) void QT7MovieRenderer::setMovie(void *movie) { - qDebug() << "QT7MovieRenderer::setMovie" << movie; +// qDebug() << "QT7MovieRenderer::setMovie" << movie; #ifdef QUICKTIME_C_API_AVAILABLE QMutexLocker locker(&m_mutex); @@ -393,7 +394,7 @@ QAbstractVideoSurface *QT7MovieRenderer::surface() const void QT7MovieRenderer::setSurface(QAbstractVideoSurface *surface) { - qDebug() << "Set video surface" << surface; +// qDebug() << "Set video surface" << surface; if (surface == m_surface) return; diff --git a/src/plugins/mediaservices/qt7/qt7movievideowidget.mm b/src/plugins/mediaservices/qt7/qt7movievideowidget.mm index 6e74fcd..4043330 100644 --- a/src/plugins/mediaservices/qt7/qt7movievideowidget.mm +++ b/src/plugins/mediaservices/qt7/qt7movievideowidget.mm @@ -184,7 +184,7 @@ QT7MovieVideoWidget::QT7MovieVideoWidget(QObject *parent) m_hue(0), m_saturation(0) { - qDebug() << "QT7MovieVideoWidget"; +// qDebug() << "QT7MovieVideoWidget"; QGLFormat format = QGLFormat::defaultFormat(); format.setSwapInterval(1); // Vertical sync (avoid tearing) @@ -249,7 +249,7 @@ void QT7MovieVideoWidget::setupVideoOutput() { AutoReleasePool pool; - qDebug() << "QT7MovieVideoWidget::setupVideoOutput" << m_movie; +// qDebug() << "QT7MovieVideoWidget::setupVideoOutput" << m_movie; if (m_movie == 0) { m_displayLink->stop(); diff --git a/src/plugins/mediaservices/qt7/qt7movieviewrenderer.mm b/src/plugins/mediaservices/qt7/qt7movieviewrenderer.mm index 342feb8..255cea1 100644 --- a/src/plugins/mediaservices/qt7/qt7movieviewrenderer.mm +++ b/src/plugins/mediaservices/qt7/qt7movieviewrenderer.mm @@ -245,7 +245,7 @@ void QT7MovieViewRenderer::setupVideoOutput() { AutoReleasePool pool; - qDebug() << "QT7MovieViewRenderer::setupVideoOutput" << m_movie << m_surface; +// qDebug() << "QT7MovieViewRenderer::setupVideoOutput" << m_movie << m_surface; HiddenQTMovieView *movieView = (HiddenQTMovieView*)m_movieView; @@ -272,14 +272,15 @@ void QT7MovieViewRenderer::setupVideoOutput() QVideoSurfaceFormat format(m_nativeSize, QVideoFrame::Format_RGB32); if (m_surface->isActive() && m_surface->surfaceFormat() != format) { - qDebug() << "Surface format was changed, stop the surface."; +// qDebug() << "Surface format was changed, stop the surface."; m_surface->stop(); } if (!m_surface->isActive()) { - qDebug() << "Starting the surface with format" << format; - if (!m_surface->start(format)) - qDebug() << "failed to start video surface" << m_surface->error(); +// qDebug() << "Starting the surface with format" << format; + m_surface->start(format); +// if (!m_surface->start(format)) +// qDebug() << "failed to start video surface" << m_surface->error(); } } } -- cgit v0.12 From b4ee6a8760d382259136da2fc5ffd624fe312b28 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Wed, 24 Feb 2010 12:49:35 +1000 Subject: Add -mediaservice argument to configure. Enables building the default media service backend for a platform. Is on by default if the build environment requirements are met and -no-mediaservice disables the option. Reviewed-by: Justin McPherson --- configure | 19 +++++++++++++++++-- src/plugins/mediaservices/mediaservices.pro | 24 +++++++++++++----------- tools/configure/configure.pro | 1 + tools/configure/configureapp.cpp | 13 ++++++++++++- 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/configure b/configure index cd29e95..c579ccc 100755 --- a/configure +++ b/configure @@ -676,6 +676,7 @@ CFG_RELEASE_QMAKE=no CFG_PHONON=auto CFG_PHONON_BACKEND=yes CFG_MULTIMEDIA=yes +CFG_MEDIASERVICE=yes CFG_AUDIO_BACKEND=yes CFG_SVG=yes CFG_DECLARATIVE=auto @@ -921,7 +922,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config) + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-mediaservice|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -2099,6 +2100,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + mediaservice) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_MEDIASERVICE="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; audio-backend) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_AUDIO_BACKEND="$VAL" @@ -3301,7 +3309,8 @@ Usage: $relconf [-h] [-prefix ] [-prefix-install] [-bindir ] [-libdir [-qtnamespace ] [-qtlibinfix ] [-separate-debug-info] [-armfpa] [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns] [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend] - [-no-audio-backend] [-audio-backend] [-no-openssl] [-openssl] [-openssl-linked] + [-no-mediaservice] [-mediaservice] [-no-audio-backend] [-audio-backend] + [-no-openssl] [-openssl] [-openssl-linked] [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-javascript-jit] [-javascript-jit] [-no-script] [-script] [-no-scripttools] [-scripttools] [-no-declarative] [-declarative] @@ -3439,6 +3448,9 @@ fi -no-multimedia ..... Do not build the QtMultimedia module. + -multimedia ........ Build the QtMultimedia module. + -no-mediaservice.... Do not build platform mediaservice plugin. + + -mediaservice ...... Build the platform mediaservice plugin. + -no-audio-backend .. Do not build the platform audio backend into QtMultimedia. + -audio-backend ..... Build the platform audio backend into QtMultimedia if available. @@ -6489,6 +6501,9 @@ if [ "$CFG_MULTIMEDIA" = "no" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MULTIMEDIA" else QT_CONFIG="$QT_CONFIG multimedia" + if [ "$CFG_MEDIASERVICE" = "yes" ]; then + QT_CONFIG="$QT_CONFIG mediaservice" + fi fi if [ "$CFG_AUDIO_BACKEND" = "yes" ]; then diff --git a/src/plugins/mediaservices/mediaservices.pro b/src/plugins/mediaservices/mediaservices.pro index 55e6aba..0cef605 100644 --- a/src/plugins/mediaservices/mediaservices.pro +++ b/src/plugins/mediaservices/mediaservices.pro @@ -1,18 +1,20 @@ TEMPLATE = subdirs -win32:!wince: SUBDIRS += directshow +contains(QT_CONFIG, mediaservice) { + win32:!wince: SUBDIRS += directshow -mac: SUBDIRS += qt7 + mac: SUBDIRS += qt7 -unix:!mac:!symbian { - TMP_GST_LIBS = \ - gstreamer-0.10 >= 0.10.19 \ - gstreamer-base-0.10 >= 0.10.19 \ - gstreamer-interfaces-0.10 >= 0.10.19 \ - gstreamer-audio-0.10 >= 0.10.19 \ - gstreamer-video-0.10 >= 0.10.19 + unix:!mac:!symbian { + TMP_GST_LIBS = \ + gstreamer-0.10 >= 0.10.19 \ + gstreamer-base-0.10 >= 0.10.19 \ + gstreamer-interfaces-0.10 >= 0.10.19 \ + gstreamer-audio-0.10 >= 0.10.19 \ + gstreamer-video-0.10 >= 0.10.19 - system(pkg-config --exists \'$${TMP_GST_LIBS}\' --print-errors): { - SUBDIRS += gstreamer + system(pkg-config --exists \'$${TMP_GST_LIBS}\' --print-errors): { + SUBDIRS += gstreamer + } } } diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index 91de7c2..d926a76 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -119,3 +119,4 @@ DEFINES += COMMERCIAL_VERSION INCLUDEPATH += $$QT_SOURCE_TREE/src/corelib/arch/generic \ $$QT_SOURCE_TREE/include/QtCore \ + $$QT_SOURCE_TREE/tools/shared diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 8c2a015..172dcd4 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -248,6 +248,7 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "PHONON_BACKEND" ] = "yes"; dictionary[ "MULTIMEDIA" ] = "yes"; dictionary[ "AUDIO_BACKEND" ] = "auto"; + dictionary[ "MEDIASERVICE"] = "auto"; dictionary[ "DIRECTSHOW" ] = "no"; dictionary[ "WEBKIT" ] = "auto"; dictionary[ "DECLARATIVE" ] = "auto"; @@ -907,6 +908,10 @@ void Configure::parseCmdLine() dictionary[ "AUDIO_BACKEND" ] = "yes"; } else if( configCmdLine.at(i) == "-no-audio-backend" ) { dictionary[ "AUDIO_BACKEND" ] = "no"; + } else if( configCmdLine.at(i) == "-mediaservice") { + dictionary[ "MEDIASERVICE" ] = "yes"; + } else if (configCmdLine.at(i) == "-no-mediaservice") { + dictionary[ "MEDIASERVICE" ] = "no"; } else if( configCmdLine.at(i) == "-no-phonon" ) { dictionary[ "PHONON" ] = "no"; } else if( configCmdLine.at(i) == "-phonon" ) { @@ -1763,6 +1768,8 @@ bool Configure::displayHelp() desc("MULTIMEDIA", "yes","-multimedia", "Compile in multimedia module"); desc("AUDIO_BACKEND", "no","-no-audio-backend", "Do not compile in the platform audio backend into QtMultimedia"); desc("AUDIO_BACKEND", "yes","-audio-backend", "Compile in the platform audio backend into QtMultimedia"); + desc("MEDIASERVICE", "no","-no-mediaservice", "Do not compile in the platform-specific QtMultimedia media service."); + desc("MEDIASERVICE", "yes","-mediaservice", "Compile in the platform-specific QtMultimedia media service."); desc("WEBKIT", "no", "-no-webkit", "Do not compile in the WebKit module"); desc("WEBKIT", "yes", "-webkit", "Compile in the WebKit module (WebKit is built if a decent C++ compiler is used.)"); desc("SCRIPT", "no", "-no-script", "Do not build the QtScript module."); @@ -2044,7 +2051,7 @@ bool Configure::checkAvailability(const QString &part) && dictionary.value("QMAKESPEC") != "win32-msvc.net" // Leave for now, since we can't be sure if they are using 2002 or 2003 with this spec && dictionary.value("QMAKESPEC") != "win32-msvc2002" && dictionary.value("EXCEPTIONS") == "yes"; - } else if (part == "PHONON") { + } else if (part == "PHONON" || part == "MEDIASERVICE") { available = findFile("vmr9.h") && findFile("dshow.h") && findFile("dmo.h") && findFile("dmodshow.h") && (findFile("strmiids.lib") || findFile("libstrmiids.a")) && (findFile("dmoguids.lib") || findFile("libdmoguids.a")) @@ -2204,6 +2211,8 @@ void Configure::autoDetection() dictionary["DECLARATIVE"] = checkAvailability("DECLARATIVE") ? "yes" : "no"; if (dictionary["AUDIO_BACKEND"] == "auto") dictionary["AUDIO_BACKEND"] = checkAvailability("AUDIO_BACKEND") ? "yes" : "no"; + if (dictionary["MEDIASERVICE"] == "auto") + dictionary["MEDIASERVICE"] = checkAvailability("MEDIASERVICE") ? "yes" : "no"; // Qt/WinCE remote test application if (dictionary["CETEST"] == "auto") @@ -2594,6 +2603,8 @@ void Configure::generateOutputVars() qtConfig += "multimedia"; if (dictionary["AUDIO_BACKEND"] == "yes") qtConfig += "audio-backend"; + if (dictionary["MEDIASERVICE"] == "yes") + qtConfig += "mediaservice"; } if (dictionary["WEBKIT"] == "yes") -- cgit v0.12 From 74706e6bd25f0a2a7e65925309c8774df1cc2ee8 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Wed, 24 Feb 2010 12:58:00 +1000 Subject: Rebuild configure.exe --- configure.exe | Bin 1008128 -> 1221632 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index 9974236..f937ea2 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From 754c72b54409f4ed124f5ba53a20f0bfc53e448d Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Wed, 24 Feb 2010 17:37:38 +1000 Subject: QMediaContent test; make sure to use network. Reviewed-by: Andrew den Exter --- tests/auto/qmediacontent/qmediacontent.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qmediacontent/qmediacontent.pro b/tests/auto/qmediacontent/qmediacontent.pro index f7884f6..6c13c8b 100644 --- a/tests/auto/qmediacontent/qmediacontent.pro +++ b/tests/auto/qmediacontent/qmediacontent.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES += tst_qmediacontent.cpp -QT = core multimedia +QT = core network multimedia -- cgit v0.12 From 63cb5d9dea14050db706ca69880a494db5a3c547 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 24 Feb 2010 10:14:25 +0100 Subject: compile fix with namespaces after a broken automatical merge --- src/multimedia/base/qmediaserviceprovider.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/multimedia/base/qmediaserviceprovider.cpp b/src/multimedia/base/qmediaserviceprovider.cpp index 76377d9..02c9b29 100644 --- a/src/multimedia/base/qmediaserviceprovider.cpp +++ b/src/multimedia/base/qmediaserviceprovider.cpp @@ -594,8 +594,6 @@ QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider() #endif } -QT_END_NAMESPACE - /*! \class QMediaServiceProviderPlugin \preliminary -- cgit v0.12 From 8a6ac436b00de84501dba5968f960dd3f4561dd3 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 25 Feb 2010 10:27:16 +1000 Subject: Change Multimedia declarative module in line with recent commits. --- src/multimedia/qml/multimediadeclarative.cpp | 15 +++++++++------ src/multimedia/qml/multimediadeclarative.h | 4 +++- src/plugins/qdeclarativemodules/multimedia/multimedia.cpp | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/multimedia/qml/multimediadeclarative.cpp b/src/multimedia/qml/multimediadeclarative.cpp index be49915..cfb8999 100644 --- a/src/multimedia/qml/multimediadeclarative.cpp +++ b/src/multimedia/qml/multimediadeclarative.cpp @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#include +#include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE @@ -55,11 +55,14 @@ namespace QtMultimedia \internal */ -void qRegisterQmlElements() +void qRegisterDeclarativeElements(QDeclarativeEngine *engine, const char *uri) { + Q_UNUSED(engine) + Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.multimedia")); + qmlRegisterType("Qt.multimedia", 4, 7, "SoundEffect", "SoundEffect"); - qmlRegisterType("Qt.multimedia", 4, 7, "Audio", "Audio"); - qmlRegisterType("Qt.multimedia", 4, 7, "Video", "Video"); + qmlRegisterType("Qt.multimedia", 4, 7, "Audio", "Audio"); + qmlRegisterType("Qt.multimedia", 4, 7, "Video", "Video"); } } diff --git a/src/multimedia/qml/multimediadeclarative.h b/src/multimedia/qml/multimediadeclarative.h index 41274c8..befddb6 100644 --- a/src/multimedia/qml/multimediadeclarative.h +++ b/src/multimedia/qml/multimediadeclarative.h @@ -49,9 +49,11 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) +class QDeclarativeEngine; + namespace QtMultimedia { -extern void Q_MULTIMEDIA_EXPORT qRegisterQmlElements(); +extern void Q_MULTIMEDIA_EXPORT qRegisterDeclarativeElements(QDeclarativeEngine* engine, const char *uri); } QT_END_NAMESPACE diff --git a/src/plugins/qdeclarativemodules/multimedia/multimedia.cpp b/src/plugins/qdeclarativemodules/multimedia/multimedia.cpp index 1158c88..e27dd8d 100644 --- a/src/plugins/qdeclarativemodules/multimedia/multimedia.cpp +++ b/src/plugins/qdeclarativemodules/multimedia/multimedia.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE @@ -51,7 +51,7 @@ class QMultimediaQmlModule : public QDeclarativeExtensionPlugin public: virtual void initialize(QDeclarativeEngine *engine, const char *uri) { - QtMultimedia::qRegisterQmlElements(engine, uri); + QtMultimedia::qRegisterDeclarativeElements(engine, uri); } }; -- cgit v0.12 From 88eb10ee9163777d7534e3c7bb297745e0ed102e Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 25 Feb 2010 10:28:30 +1000 Subject: Fix include of renamed header --- src/multimedia/qml/qdeclarativeaudio_p.h | 2 +- src/multimedia/qml/qdeclarativevideo_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/multimedia/qml/qdeclarativeaudio_p.h b/src/multimedia/qml/qdeclarativeaudio_p.h index a3fe1e8..d1fb275 100644 --- a/src/multimedia/qml/qdeclarativeaudio_p.h +++ b/src/multimedia/qml/qdeclarativeaudio_p.h @@ -53,7 +53,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/multimedia/qml/qdeclarativevideo_p.h b/src/multimedia/qml/qdeclarativevideo_p.h index 8d9ec20..d5ebde1 100644 --- a/src/multimedia/qml/qdeclarativevideo_p.h +++ b/src/multimedia/qml/qdeclarativevideo_p.h @@ -53,7 +53,7 @@ // We mean it. // -#include +#include #include -- cgit v0.12 From b888a694c35fb0c291942a2aa4a056d7deec3245 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 25 Feb 2010 10:29:39 +1000 Subject: Revert "Add QDeclarativeGraphicsWidget, a QGraphicsWidget version of QmlView" This reverts commit 327d212f5cff81f1c21b7be5c54b3e1eab4f0ac5. --- doc/src/declarative/integrating.qdoc | 10 - .../util/qdeclarativegraphicswidget.cpp | 457 --------------------- src/declarative/util/qdeclarativegraphicswidget.h | 113 ----- src/declarative/util/util.pri | 6 +- 4 files changed, 2 insertions(+), 584 deletions(-) delete mode 100644 src/declarative/util/qdeclarativegraphicswidget.cpp delete mode 100644 src/declarative/util/qdeclarativegraphicswidget.h diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc index 09ed178..c685d3d 100644 --- a/doc/src/declarative/integrating.qdoc +++ b/doc/src/declarative/integrating.qdoc @@ -86,9 +86,6 @@ QGraphicsObject *object = scene->addItem(object); \endcode -There is a convenience QGraphicsWidget subclass, QDeclarativeGraphicsWidget, which takes care of the engine -and component instantiation for you. - The following QGraphicsView options are recommended for optimal performance of QML UIs: @@ -98,13 +95,6 @@ of QML UIs: \o QGraphicsScene::setItemIndexMethod(QGraphicsScene::NoIndex); \endlist -And the following QGraphicsView options are required for QML key handling to work: - -\list -\o QGraphicsView::viewport()->setFocusPolicy(Qt::NoFocus); -\o QGraphicsScene::setStickyFocus(true); -\endlist - \section1 Using existing QGraphicsWidgets in QML Another way of integrating with a QGraphicsView based UI is to expose your existing QGraphicsWidgets to QML, and constructing your scene in QML. Note that diff --git a/src/declarative/util/qdeclarativegraphicswidget.cpp b/src/declarative/util/qdeclarativegraphicswidget.cpp deleted file mode 100644 index 1d0d468..0000000 --- a/src/declarative/util/qdeclarativegraphicswidget.cpp +++ /dev/null @@ -1,457 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qdeclarativegraphicswidget.h" - -#include "qperformancelog_p_p.h" -#include "qfxperf_p_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QDeclarativeGraphicsWidgetSharedQDeclarativeEngine -{ -public: - QDeclarativeGraphicsWidgetSharedQDeclarativeEngine(){} - - static QDeclarativeEngine* sharedEngine(){ - if(!references) - return 0; - return &QDeclarativeGraphicsWidgetSharedQDeclarativeEngine::m_instance->engine; - } - static void attach(){ - if(!references++) - m_instance = new QDeclarativeGraphicsWidgetSharedQDeclarativeEngine(); - } - - static void detach(){ - if(!--references) - delete m_instance; - } - -private: - static QDeclarativeGraphicsWidgetSharedQDeclarativeEngine* m_instance; - static int references; - QDeclarativeEngine engine; -}; - -int QDeclarativeGraphicsWidgetSharedQDeclarativeEngine::references = 0; -QDeclarativeGraphicsWidgetSharedQDeclarativeEngine* QDeclarativeGraphicsWidgetSharedQDeclarativeEngine::m_instance = 0; - -class QDeclarativeGraphicsWidgetPrivate -{ -public: - QDeclarativeGraphicsWidgetPrivate() - : root(0), component(0), - resizeMode(QDeclarativeGraphicsWidget::SizeViewToRootObject) - { - QDeclarativeGraphicsWidgetSharedQDeclarativeEngine::attach(); - engine = QDeclarativeGraphicsWidgetSharedQDeclarativeEngine::sharedEngine(); - } - - ~QDeclarativeGraphicsWidgetPrivate() - { - QDeclarativeGraphicsWidgetSharedQDeclarativeEngine::detach(); - } - - QGuard root; - QGuard declarativeRoot; - - QUrl source; - - QDeclarativeEngine* engine; - QDeclarativeComponent *component; - QBasicTimer resizetimer; - - mutable QSize initialSize; - QDeclarativeGraphicsWidget::ResizeMode resizeMode; - - void init(); - -}; - -/*! - \class QDeclarativeGraphicsWidget - \brief The QDeclarativeGraphicsWidget class provides a QGraphicsWidget for displaying a Qt Declarative user interface. - - Any QGraphicsObject or QDeclarativeGraphicsItem - created via Qt Declarative can be placed on a standard QGraphicsScene and viewed with a standard - QGraphicsView. - - QDeclarativeGraphicsWidget is a convenience class which handles QDeclarativeComponent loading and object creation. - It shares the same QDeclarativeEngine between all QDeclarativeGraphicsWidgets in the application, to minimize overhead. - - QDeclarativeGraphicsWidget is ideal for when you have many small components styled with Qt Declarative, and want to integrate - them into a larger QGraphicsItem based scene. If your interface is primarily Qt Declarative based, consider using QDeclarativeView - instead. - - Note that the following settings on your QGraphicsScene/View are recommended for optimal performance with Qt Declarative: - \list - \o QGraphicsView::setOptimizationFlags(QGraphicsView::DontSavePainterState); - \o QGraphicsView::setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); - \o QGraphicsScene::setItemIndexMethod(QGraphicsScene::NoIndex); - \endlist - Also note that the following settings on your QGraphicsScene/View are required for key handling in Qt Declarative to work: - \list - \o QGraphicsView::viewport()->setFocusPolicy(Qt::NoFocus); - \o QGraphicsScene::setStickyFocus(true); - \endlist - - To receive errors related to loading and executing declarative files with QDeclarativeGraphicsWidget, - you can connect to the statusChanged() signal and monitor for QDeclarativeGraphicsWidget::Error. - The errors are available via QDeclarativeGraphicsWidget::errors(). -*/ - - -/*! \fn void QDeclarativeGraphicsWidget::sceneResized(QSize size) - This signal is emitted when the view is resized to \a size. -*/ - -/*! \fn void QDeclarativeGraphicsWidget::statusChanged(QDeclarativeGraphicsWidget::Status status) - This signal is emitted when the component's current \l{QDeclarativeGraphicsWidget::Status} {status} changes. -*/ - -/*! - \fn QDeclarativeGraphicsWidget::QDeclarativeGraphicsWidget(QGraphicsItem *parent) - - Constructs a QDeclarativeGraphicsWidget with the given \a parent. -*/ -QDeclarativeGraphicsWidget::QDeclarativeGraphicsWidget(QGraphicsItem *parent) -: QGraphicsWidget(parent), d(new QDeclarativeGraphicsWidgetPrivate) -{ - setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); - d->init(); -} - -void QDeclarativeGraphicsWidgetPrivate::init() -{ -} - -/*! - The destructor clears the view's \l {QGraphicsObject} {items} and - deletes the internal representation. - */ -QDeclarativeGraphicsWidget::~QDeclarativeGraphicsWidget() -{ - delete d->root; - delete d; -} - -/*! - Sets the source to the \a url. - - Will also load the QML file and instantiate the component. - - */ -void QDeclarativeGraphicsWidget::setSource(const QUrl& url) -{ - d->source = url; - - //Execute - if(d->root) - delete d->root; - if(d->component) - delete d->component; - d->component = new QDeclarativeComponent(d->engine, d->source, this); - - if (!d->component->isLoading()) { - continueExecute(); - } else { - connect(d->component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), this, SLOT(continueExecute())); - } -} - -/*! - Returns the source URL, if set. - - \sa setSource() - */ -QUrl QDeclarativeGraphicsWidget::source() const -{ - return d->source; -} - -/*! - Returns a pointer to the QDeclarativeEngine used for instantiating - Qt Declarative Components. - */ -QDeclarativeEngine* QDeclarativeGraphicsWidget::engine() -{ - return d->engine; -} - -/*! - This function returns the root of the context hierarchy. Each declarative - component is instantiated in a QDeclarativeContext. QDeclarativeContext's are - essential for passing data to declarative components. In Qt Declarative, contexts are - arranged hierarchically and this hierarchy is managed by the - QDeclarativeEngine. - */ -QDeclarativeContext* QDeclarativeGraphicsWidget::rootContext() -{ - return d->engine->rootContext(); -} - - -/*! - \enum QDeclarativeGraphicsWidget::Status - - Specifies the loading status of the QDeclarativeGraphicsWidget. - - \value Null This QDeclarativeGraphicsWidget has no source set. - \value Ready This QDeclarativeGraphicsWidget has loaded and created the declarative component. - \value Loading This QDeclarativeGraphicsWidget is loading network data. - \value Error An error has occured. Calling errorDescription() to retrieve a description. -*/ - -/*! - \property QDeclarativeGraphicsWidget::status - The component's current \l{QDeclarativeGraphicsWidget::Status} {status}. -*/ - -QDeclarativeGraphicsWidget::Status QDeclarativeGraphicsWidget::status() const -{ - if (!d->component) - return QDeclarativeGraphicsWidget::Null; - - return QDeclarativeGraphicsWidget::Status(d->component->status()); -} - -/*! - Return the list of errors that occured during the last compile or create - operation. An empty list is returned if isError() is not set. -*/ -QList QDeclarativeGraphicsWidget::errors() const -{ - if (d->component) - return d->component->errors(); - return QList(); -} - - -/*! - \property QDeclarativeGraphicsWidget::resizeMode - \brief whether the view should resize the canvas contents - - If this property is set to SizeViewToRootObject (the default), the view - resizes with the root item in the declarative file. - - If this property is set to SizeRootObjectToView, the view will - automatically resize the root item. - - Regardless of this property, the sizeHint of the view - is the initial size of the root item. Note though that - since declarative files may load dynamically, that size may change. - - \sa initialSize() -*/ - -void QDeclarativeGraphicsWidget::setResizeMode(ResizeMode mode) -{ - if (d->resizeMode == mode) - return; - - d->resizeMode = mode; - if (d->declarativeRoot) { - if (d->resizeMode == SizeRootObjectToView) { - d->declarativeRoot->setWidth(size().width()); - d->declarativeRoot->setHeight(size().height()); - } else { - d->declarativeRoot->setWidth(d->initialSize.width()); - d->declarativeRoot->setHeight(d->initialSize.height()); - } - } -} - -QDeclarativeGraphicsWidget::ResizeMode QDeclarativeGraphicsWidget::resizeMode() const -{ - return d->resizeMode; -} - -/*! - \internal - */ -void QDeclarativeGraphicsWidget::continueExecute() -{ - - disconnect(d->component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), this, SLOT(continueExecute())); - - if (d->component->isError()) { - QList errorList = d->component->errors(); - foreach (const QDeclarativeError &error, errorList) { - qWarning() << error; - } - emit statusChanged(status()); - return; - } - - QObject *obj = d->component->create(); - - if(d->component->isError()) { - QList errorList = d->component->errors(); - foreach (const QDeclarativeError &error, errorList) { - qWarning() << error; - } - emit statusChanged(status()); - return; - } - - if (obj) { - if (QDeclarativeItem *item = qobject_cast(obj)) { - - item->QGraphicsItem::setParentItem(this); - item->QObject::setParent(this); - - d->root = item; - d->declarativeRoot = item; - connect(item, SIGNAL(widthChanged()), this, SLOT(sizeChanged())); - connect(item, SIGNAL(heightChanged()), this, SLOT(sizeChanged())); - if (d->initialSize.height() <= 0 && d->declarativeRoot->width() > 0) - d->initialSize.setWidth(d->declarativeRoot->width()); - if (d->initialSize.height() <= 0 && d->declarativeRoot->height() > 0) - d->initialSize.setHeight(d->declarativeRoot->height()); - resize(d->initialSize); - - if (d->resizeMode == SizeRootObjectToView) { - d->declarativeRoot->setWidth(size().width()); - d->declarativeRoot->setHeight(size().height()); - } else { - QSizeF sz(d->declarativeRoot->width(),d->declarativeRoot->height()); - emit sceneResized(sz); - resize(sz); - } - updateGeometry(); - } else if (QGraphicsObject *item = qobject_cast(obj)) { - item->setParent(this); - qWarning() << "QDeclarativeGraphicsWidget::resizeMode is not honored for components of type QGraphicsObject"; - } else if (qobject_cast(obj)) { - qWarning() << "QDeclarativeGraphicsWidget does not support loading QML files containing QWidgets"; - } - } - emit statusChanged(status()); -} - -/*! - \internal - */ -void QDeclarativeGraphicsWidget::sizeChanged() -{ - // delay, so we catch both width and height changing. - d->resizetimer.start(0,this); -} - -/*! - \internal - If the \l {QTimerEvent} {timer event} \a e is this - view's resize timer, sceneResized() is emitted. - */ -void QDeclarativeGraphicsWidget::timerEvent(QTimerEvent* e) -{ - if (!e || e->timerId() == d->resizetimer.timerId()) { - if (d->declarativeRoot) { - QSize sz(d->declarativeRoot->width(),d->declarativeRoot->height()); - emit sceneResized(sz); - } - d->resizetimer.stop(); - updateGeometry(); - } -} - -/*! - \internal - The size hint is the size of the root item. -*/ -QSizeF QDeclarativeGraphicsWidget::sizeHint() const -{ - if (d->declarativeRoot) { - if (d->initialSize.width() <= 0) - d->initialSize.setWidth(d->declarativeRoot->width()); - if (d->initialSize.height() <= 0) - d->initialSize.setHeight(d->declarativeRoot->height()); - } - return d->initialSize; -} - -/*! - Returns the view's root \l {QGraphicsObject} {item}. - */ -QGraphicsObject *QDeclarativeGraphicsWidget::rootObject() const -{ - return d->root; -} - -/*! - \internal - This function handles the \l {QGraphicsSceneResizeEvent} {resize event} - \a e. - */ -void QDeclarativeGraphicsWidget::resizeEvent(QGraphicsSceneResizeEvent *e) -{ - if (d->resizeMode == SizeRootObjectToView && d->declarativeRoot) { - d->declarativeRoot->setWidth(size().width()); - d->declarativeRoot->setHeight(size().height()); - } - QGraphicsWidget::resizeEvent(e); -} - -QT_END_NAMESPACE diff --git a/src/declarative/util/qdeclarativegraphicswidget.h b/src/declarative/util/qdeclarativegraphicswidget.h deleted file mode 100644 index 33ebc7b..0000000 --- a/src/declarative/util/qdeclarativegraphicswidget.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEGRAPHICSWIDGET_H -#define QDECLARATIVEGRAPHICSWIDGET_H - -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QGraphicsObject; -class QDeclarativeEngine; -class QDeclarativeContext; -class QDeclarativeError; - -class QDeclarativeGraphicsWidgetPrivate; - -class Q_DECLARATIVE_EXPORT QDeclarativeGraphicsWidget : public QGraphicsWidget -{ - Q_OBJECT - Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode) - Q_PROPERTY(Status status READ status NOTIFY statusChanged) - Q_PROPERTY(QUrl source READ source WRITE setSource) - -public: - explicit QDeclarativeGraphicsWidget(QGraphicsItem *parent = 0); - virtual ~QDeclarativeGraphicsWidget(); - - QUrl source() const; - void setSource(const QUrl&); - - QDeclarativeEngine* engine(); - QDeclarativeContext* rootContext(); - - QGraphicsObject *rootObject() const; - - enum ResizeMode { SizeViewToRootObject, SizeRootObjectToView }; - ResizeMode resizeMode() const; - void setResizeMode(ResizeMode); - QSizeF sizeHint() const; - - enum Status { Null, Ready, Loading, Error }; - Status status() const; - - QList errors() const; - -Q_SIGNALS: - void sceneResized(QSizeF size); - void statusChanged(QDeclarativeGraphicsWidget::Status); - -private Q_SLOTS: - void continueExecute(); - void sizeChanged(); - -protected: - virtual void resizeEvent(QGraphicsSceneResizeEvent *); - void timerEvent(QTimerEvent*); - -private: - QDeclarativeGraphicsWidgetPrivate* d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEGRAPHICSWIDGET_H diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri index 46126e5..610eb3f 100644 --- a/src/declarative/util/util.pri +++ b/src/declarative/util/util.pri @@ -30,8 +30,7 @@ SOURCES += \ $$PWD/qdeclarativedatetimeformatter.cpp \ $$PWD/qdeclarativebehavior.cpp \ $$PWD/qdeclarativefontloader.cpp \ - $$PWD/qdeclarativestyledtext.cpp \ - $$PWD/qdeclarativegraphicswidget.cpp + $$PWD/qdeclarativestyledtext.cpp HEADERS += \ $$PWD/qdeclarativeutilmodule_p.h\ @@ -66,8 +65,7 @@ HEADERS += \ $$PWD/qdeclarativedatetimeformatter_p.h \ $$PWD/qdeclarativebehavior_p.h \ $$PWD/qdeclarativefontloader_p.h \ - $$PWD/qdeclarativestyledtext_p.h \ - $$PWD/qdeclarativegraphicswidget.h + $$PWD/qdeclarativestyledtext_p.h contains(QT_CONFIG, xmlpatterns) { QT+=xmlpatterns -- cgit v0.12